1-Hit Sword

Discussion in 'Plugin Development' started by derHummlerLP, Dec 19, 2016.

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


    I'd like do create a plugin with a 1-Hit-Sword, but without sharpness because i don't want an enchantment texture.

    What need I to write in the javascript?

    PS: I'm german, my english is not the best. :)
  2. Offline

    bwfcwalshy Retired Staff

  3. Offline


    What? When did we start writing plugins for JavaScript :p? However if your English is bad and you do know Bukkit API+Java, then here's how to do it. Make an ItemMeta of whatever kinda sword you want. let's say it's a golden sword and called gswordmeta. Then do an EntityDamageByEntityEvent and check to see if they're players (Or if you want it to work on mobs too, your choice.) then check to see if their sword meta matches the sword meta you made. If it is get the entity and set their health to zero. At least I think that's how you'd do it.
  4. Offline


    On damage given event or something, then if they are holding the sword, kill the player they damaged.
  5. Offline


    You'd either want to cancel the event or set the damage to be insanely high. Just outright killing them can cause a death to happen twice. Found that out the hard way.
Thread Status:
Not open for further replies.

Share This Page