Damage Events

Discussion in 'Plugin Development' started by Cooper PluginDev, Dec 25, 2013.

Thread Status:
Not open for further replies.
  1. So I'm trying to make it so when you're wearing chain boots you don't fall damage. It's working fine but the problem is every boot cancels damage.
    http://pastebin.com/eDqzAccg
     
  2. Offline

    KaiPol

    if (player.getEquipment().getBoots().getType() == Material.CHAINMAIL_BOOTS);
    you have no brackets you just ended it with ";"
    Cooper PluginDev
     
  3. Offline

    ThunderWaffeMC

    Instead of using pastebin, syntax your code on the forum post. And KaiPol is correct.
     
  4. You might want to read it more carefully?

    I do have the barracks there mate...

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  5. Offline

    xTigerRebornx

  6. xTigerRebornx Could you type the line of code out correctly? I don't know where you mean xD

    Never mind I fixed it! Thanks guys!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  7. Offline

    xTigerRebornx

    Cooper PluginDev
    Code:
    if (player.getEquipment().getBoots().getType() == Material.CHAINMAIL_BOOTS);
    there are no open/closing brackets on this line of code, so its doing nothing after you check for it (Brackets are {})
     
  8. xTigerRebornx It's not working? Now any boots you wear cancels the fall damage?
     
  9. Offline

    xTigerRebornx

  10. Offline

    xTigerRebornx

    Cooper PluginDev I'm sorry to ask, but do you even know Java? :l

    Code:
     if (player.getEquipment().getBoots().getType() == Material.CHAINMAIL_BOOTS);{}
    If you knew java, you'd instantly see the problem. I reccomend learning Java before trying to use a 3rd party API. And if you do know it, then try and learn some more, as this is basic Java.
    You need the rest of your checks inside of the {}, just adding the {} wont do anything
     
  11. xTigerRebornx I code commands I'm not good with abilities go easy on me sheesh.
     
  12. Offline

    xTigerRebornx

    Cooper PluginDev Its not a matter of "commands" or "abilities", its a matter of knowing "Java" and knowing how to copy a tutorial. You will continue to struggle with simple things like this if you don't learn a good ammount of the language before trying to tackle a Third Party API
     
Thread Status:
Not open for further replies.

Share This Page