enchantment <name>:since 1.7.17At the left margin. One to four plain words, not the name of one of the game's enchantments
enchantment lifesteal:
max level: 3
on hit:
add {_level} to health of playerTry it← All of the Docs Items
enchantment <name>:since 1.7.17At the left margin. One to four plain words, not the name of one of the game's enchantments
enchantment lifesteal:
max level: 3
on hit:
add {_level} to health of playerTry itmax level: <n>since 1.7.17The highest level that counts, 5 unless you say otherwise; an item with more acts as if it had this many
enchantment thorns of fire:
max level: 2
on hurt:
ignite attacker for 3 secondsTry iton hit:since 1.7.17Runs when a player hits something with the item in their main hand. victim, damage and the rest are there as in on hit:
enchantment lightning:
on hit:
if chance of 20%:
strike lightning at victimTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.attacker% | attacker | text | Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling |
%event.victim% | victim | text | Who was hurt: a player's name or a mob type |
%event.damage% | damage | number | Damage actually taken, after armour and effects; 2 is one heart |
%event.cause% | cause | text | Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on |
%event.entity% | entity | text | The victim's entity type, e.g. player or zombie |
%event.location% | location | Where the victim is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobodyon hurt:since 1.7.17Runs when a player is hurt by someone while wearing the item, or holding it in either hand
enchantment dodge:
on hurt:
if chance of 10%:
cancel event
send "&7Dodged!"Try iton block break:Runs when a player breaks a block with the item in their main hand
enchantment prospector:
on block break:
if event.block is "stone":
if chance of 5%:
give player 1 gold nuggetTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type, e.g. diamond_ore |
%event.location% | location | Where the block is | |
%event.drops% | list | The items the block will drop with the tool in the player's hand | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player breaking the blockA script can make up an enchantment: a name, and what happens when an item that carries it is used.
enchantment lifesteal:
max level: 3
on hit:
add {_level} to health of player
command /vampire:
trigger:
give player 1 iron sword enchanted with lifesteal 2
| Line | Meaning |
|---|---|
enchantment <name>: | At the left margin. One to four plain words, not the name of one of the game's enchantments |
max level: <n> | The highest level that counts, 5 unless you say otherwise; an item with more acts as if it had this many |
on hit: | Runs when a player hits something with the item in their main hand. victim, damage and the rest are there as in on hit: |
on hurt: | Runs when a player is hurt by someone while wearing the item, or holding it in either hand |
on block break: | Runs when a player breaks a block with the item in their main hand |
{_level} is the level on the item, and player is whoever holds it.enchanted with lifesteal 2, alone or among the game's own (enchanted with sharpness 5, lifesteal 1), in give, in an item <name>:, or with enchant tool of player with .... Any script can use an enchantment another file defines.Lifesteal II) and has no enchantment shimmer because of it; add glowing for that. They cannot be had from an enchanting table or combined on an anvil.