Modding Help Item Held SMAPI

Discussion in 'Mods' started by Mortal_Goddess, Aug 26, 2017.

  1. Mortal_Goddess

    Mortal_Goddess Space Spelunker

    I am looking for an event handler in SMAPI that indicates what item the player is currently holding. I basically want
    if(HeldItem == specific item && pressedKey == "Shift")
    {
    replace specific item with custom item
    }
     
    • Entoarox

      Entoarox Oxygen Tank

      No such event natively exists in SMAPI, EntoaroxFramework adds a event for when the held item changed, and you are welcome to re-use the code used to trigger that event if you dont want your mod to depend on EF.
       
      • Mortal_Goddess

        Mortal_Goddess Space Spelunker

        Does the framework pass the new item as a parameter? Or am I going to have to wait for it?
         
        • Entoarox

          Entoarox Oxygen Tank

          EF passes both the previous and new item in its event, but if you are going to use the raw code you will need to copy the observer that triggers the event.
           

          Share This Page