When the player hits an entity with the wand, the entity will disappear:
We can achieve this with three steps:
Wand of Vanishing
magicWand_Vanishinga display name, lore, and hidden enchantment.
magicWandand two other ingredients (shown here using a golden carrot and fermented spider eye)
Here is a list of every item in Minecraft: Spigot Materials
You'll see the
golden carrot entry written as GOLDEN_CARROT, however we don't use underscores when accessing an item, we use camelCase:
Every in-game action activates an
Example events include:
You can see a full list of event names here
Make sure you see the message "EntityDamageByEntity Event triggered" whenever you deal damage to another entity.
Make sure a burning skeleton no longer broadcasts the message!
You should only see the message printed when you hit an entity holding a
magicWand_Vanishing in your main hand.
We'll do this in three steps:
.remove()method to make the damagee disappear.
Make sure you can make entities vanish from the world with a single click!
Now you may notice that they turn red as they get damaged right before vanishing, we will fix that next.
The entity you cast the vanishing spell on should no longer turn red from taking damage before disappearing!
Create a variable called vanish particle and set it to one of Minecraft's particle effects
I chose the spell particle, a complete list of particles can be found here
If you used the example particle effect you should see an effect like this: