Can you add potion effects to custom items?

Discussion in 'Plugin Development' started by Knight_of_Ni, May 31, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Knight_of_Ni

    I am new to plugin making and recently I have been playing around with custom items and custom crafting recipes. I want to make a plugin that if the player has one particular custom item in hand, it gives them a potion effect, such as invisibility. I have seen plugins like this on some servers I go on and was wondering how to do this myself.
     
  2. Offline

    ForsakenRealmz

    @Knight_of_Ni Easier for me to say then done, but I do believe there is an event out there that allows you to run stuff when a player equips an item. You could then check the item meta of the equipped item, and if it is the custom item then give the player a potion effect.
     
  3. Offline

    VG.Developments

    If im understanding you correctly this is what you should do;
    Create/use a PlayerInteractEvent
    Check the action
    Probably should check if its ItemMeta is equal to what the custom item should be. (Like a custom lore / display name?)
    Then give them the potion effect.
     
  4. Offline

    Knight_of_Ni

    I got it to work. thx for the help : )
     
Thread Status:
Not open for further replies.

Share This Page