Classes/Events

Discussion in 'Plugin Development' started by IAmSuperBoss, Mar 19, 2015.

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

    IAmSuperBoss

    I was just wondering as I was playing some of my favorite servers, how they manage your kit/class, especially on the Hypixel server. I was playing MW, and all of a sudden, I thought, "How do they manage that when you right click, it shoots wither skulls, but another kit heals themselves?" Along with this, I was wondering how a kit system works. Is it an extension of the Player class, or is it a permission? Sorry if this question is nooby or in the wrong section, but this is my first forum post and I've only made a plugin or two. I don't really need an answer, but I'd love to get one, and I'd really like to learn to be a great Bukkit plugin maker.
     
  2. Offline

    Skionz

    @IAmSuperBoss Kits: Inventory#addItem(ItemStack), or Inventory#setItem(int, ItemStack)
    Hypixel: Listen to the PlayerInteractEvent
     
  3. Offline

    IAmSuperBoss

    @Skionz
    Thanks for the Hypixel answer, but I still have some questions. Even if I listen for PlayerInteractEvent, it doesn't tell me what class they are. How would I do that? (Basically, I still want to know how his kit and mine do different things when we both right click the same sword.) Also, how do I know if the player is a Wolf or Sheep and give items accordingly upon death?
     
  4. Offline

    ElliottOlson

    You would have to store the player's kit, and then you could check what that players kit is and if it is what you want, you could have a different result. As for the Wolf or Sheep question, you need to store that information as well. The best storage option would probably be YML as it can survive a server reload or restart.
     
Thread Status:
Not open for further replies.

Share This Page