Skip to content

Built-in triggers

This is an exhaustive list of all triggers provided by UnderscoreEnchants as of v2.2.

Preamble

Triggers provide data retrieval methods (for example, the bow-hit trigger provides a getDamager method as a DataRetrievalType.FIRST_PLAYER). Data retrieval types are similar to targets in actions and conditions, but more extensive. They are used internally and not configurably by enchantments. The whole list of data retrieval types is provided below for reference, and outlined in the developer guide as well.

  • first_player
  • second_player
  • third_player
  • entity
  • block
  • damage
  • damage_cause
  • first_item
  • second_item

armorequip

Info

Triggers when a player equips/unequips a piece of armor.

Aliases: armor-equip, armorequipevent, armor-equip-event, equip

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • first_item - the new item
  • second_item - the old item

This trigger is marked as stable as of 2.2.

blockbreak

Info

Triggers when a player breaks a block.

Aliases: block-break, blockbreak-event, block-break-event

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • block - the broken block

This trigger is marked as stable as of 2.2.

bowhit

Info

Triggers when a player hits another player with an arrow shot from a bow.

Aliases: bow, hit, bow-hit

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment and shot the bow
  • second_player - the victim
  • damage - the damage

This trigger is marked as stable as of 2.2.

gothurt

Info

Triggers when the player receives damage.

Aliases: playergothurt, playergothurtevent, gothurtevent, got-hurt

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment and got hurt
  • damage - the damage
  • damage_cause - the damage cause

This trigger is marked as stable as of 2.2.

interact

Info

Triggers when a player interacts with the environment.

Aliases: rmb, rightclick, rightclickevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment

This trigger is marked as stable as of 2.2.

itembreak

Info

Triggers when a player breaks an item.

Aliases: item-break, itembreakevent, item-break-event

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • first_item - the broken item

This trigger is marked as stable as of 2.2.

itemeat

Info

Triggers when a player eat an item.

Aliases: item-eat, itemconsume, item-consume, itemconsumeevent item-consume-event

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • first_item - the eaten item

This trigger is marked as stable as of 2.2.

jump

Info

Triggers when a player jumps.

Aliases: playerjump, player-jump, player-jump-event, jumpevent, playerjumpevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment

This trigger is marked as stable as of 2.2.

move

Info

Triggers when a player moves.

Aliases: playermove, player-move, player-move-event, moveevent, playermoveevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment

This trigger is marked as stable as of 2.2.

playerhurtentity

Info

Triggers when a player hurts an entity.

Aliases: playerhurtsentity, playerhurtentityevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • entity - the victim
  • damage - the damage

This trigger is marked as stable as of 2.2.

playershootbow

Info

Triggers when a player shoots a bow.

Aliases: playershootbowevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment

This trigger is marked as stable as of 2.2.

pvp

Info

Triggers when a player attacks another player.

Aliases: player-vs-player, playervsplayer, pvpevent, pvp-event

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • second_player - the victim
  • damage - the damage

This trigger is marked as stable as of 2.2.

rmbentity

Info

Triggers when a player right-clicks an entity.

Aliases: rightclickentity, rightclickentityevent

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment
  • entity - the entity

This trigger is marked as stable as of 2.2.

sneak

Info

Triggers when a player sneaks/unsneaks.

Aliases: sneakevent, sneaking, shift, shifting

Provides the following data retrieval means:

  • first_player - the player who has activated the enchantment

This trigger is marked as stable as of 2.2.