How do i create my own custom items and where do i store the data of them?

Discussion in 'Plugin Development' started by niehoelzz, May 14, 2017.

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

    niehoelzz

    For example i want to create a stick that shoots an arrow when you right click with it. Where do i store the data of this stick?

    My attempt was to have a PlayerInteractEvent which looks up the name of the used item and then does what that item should do. I managed to create a stick that shoots fireballs but the problem is that every stick now shoots fireballs even if i rename the stick.

    So my Playerinteract event now looks up the Material of the item i have in my main, but what i want to do is:
    Playerinteract event looks up the name of the item currently in the players main hand,
    then goes inside some kind of storage place for items (class? file? i dont know, thats a part of my question)
    and looks up what that item should do when you interact

    I dont know if you understood what i wanted to ask, so please answer the topic question if i confused you with my explaination :p
     
  2. Offline

    Zombie_Striker

    @niehoelzz
    You can either give the stick a custom name, or you can add a new line of lore and check for that in the event. That is the easiest way of doing this.
     
    ipodtouch0218 likes this.
Thread Status:
Not open for further replies.

Share This Page