No edit summary
No edit summary
Line 5: Line 5:
== Actions ==
== Actions ==
Many events prevent certain actions from being added, such as how Group Change disables the action Change Player Group. This is likely to combat [https://en.wikipedia.org/w/Recursion recursion], a way to infinitely loop something.
Many events prevent certain actions from being added, such as how Group Change disables the action Change Player Group. This is likely to combat [https://en.wikipedia.org/w/Recursion recursion], a way to infinitely loop something.
Event Actions can hold up to 30 conditional actions in a single action chain as opposed to the default 15.


=== Cancelling events ===
=== Cancelling events ===
Line 11: Line 13:
The Player Block Break event only triggers when a block is ''not'' successfully broken, and thus does not have the action available.
The Player Block Break event only triggers when a block is ''not'' successfully broken, and thus does not have the action available.


== Conditions ==
=== Additional conditions ===
Many Action Events support additional conditions within [[Conditionals]], allowing for actions to be run when an event is of a certain type or meets a certain criteria.  
The [[Conditional]] action has extra conditions to choose from in certain event actions. Below are all of the added event action conditions that are not usable outside of their respective contexts.  
 
{| class="wikitable sortable"
{| class="wikitable sortable"
|+ Additional conditions
|+
|-
!Event Action
! Condition !! class="unsortable" |Settings !! Action Event(s) !! class="unsortable" |Additional Notes
!Condition
!Description
!Notes
|-
|-
| Pvp Enabled || - || Pvp State Change || -
|PvP Stage Change
|PvP Enabled
|Requires the PvP state to have changed to enabled.
|
|-
|-
| Fishing Environment || Water or Lava || Fish Caught || Lava fishing requires the ''lavaFishing'' [[gamerule]] to be enabled.
|Fish Caught
|Fishing Environment
|Check the type of environment that the player fished in.
|Lava Fishing requires the <nowiki><code>lavaFishing</code></nowiki> [[Game Rules|game rule]] to be enabled.
|-
|-
| Portal Type || Nether Portal or End Portal || Enter Portal || Players in survival mode will enter a Nether Portal after 4 seconds.
|Player Enter Portal
|Portal Type
|Check the type of portal that was used by the player.
|Players in survival mode will trigger Nether Portals after 4 seconds, while creative mode is instant.
|-
|-
| Damage Cause || Various damage causes || Player Damage || -
|Player Damage
|Damage Cause
|Check the type of damage that was taken by the player.
|
|-
|-
| Damage Amount || Comparator and Compare Value || Player Damage || -
|Player Damage
|Damage Amount
|Check the amount of damage that was taken by the player.
|
|-
|-
| Block Type || Block Selector and Type Requirement Boolean || Player Break Block || -
|Player Block Break
|Block Type
|Check that the type of block that has been broken matches the item provided.
|
|-
|-
| Within Region || Region Selector || Player Break Block || This condition replaces the standard ''Within Region'' condition, testing for the broken block's location rather than the player's.
|Player Block Break
|Within Region
|Requires the location to be within the selected region.
|The appearance is the same as the regular condition, but the behaviour takes the position of the block instead of the player.
|-
|-
| Is Item || Item Selector, Metadata Boolean, Inventory Selector, and Required Amount || Player Drop Item, Player Pick Up Item, and Player Change Held Item
|Player Drop Item
| -
Player Pick Up Item
Player Change Held Item
|Is Item
|Requires the item for the event to match the required cases.
|
|}
|}

Revision as of 19:32, 3 September 2024

Event Actions, or simply events, are a system in Housing that allow for chains of actions to be triggered on a player when they fire a certain event within the house, such as joining, dying, getting a kill or dropping an item.

Event Actions were added in 2021 alongside Local Stats, the precursor to player stats. At the time, only Player Join, Player Death, Player Kill and Player Respawn were supported. As of 2024, there are 18 supported types of events.

Actions

Many events prevent certain actions from being added, such as how Group Change disables the action Change Player Group. This is likely to combat recursion, a way to infinitely loop something.

Event Actions can hold up to 30 conditional actions in a single action chain as opposed to the default 15.

Cancelling events

Some events have the ability to be cancelled through the Cancel Event action, such as Player Drop Item. This will stop the event before it is triggered. For example, by cancelling the Player Damage event you will stop the player from taking damage.

The Player Block Break event only triggers when a block is not successfully broken, and thus does not have the action available.

Additional conditions

The Conditional action has extra conditions to choose from in certain event actions. Below are all of the added event action conditions that are not usable outside of their respective contexts.

Event Action Condition Description Notes
PvP Stage Change PvP Enabled Requires the PvP state to have changed to enabled.
Fish Caught Fishing Environment Check the type of environment that the player fished in. Lava Fishing requires the <code>lavaFishing</code> game rule to be enabled.
Player Enter Portal Portal Type Check the type of portal that was used by the player. Players in survival mode will trigger Nether Portals after 4 seconds, while creative mode is instant.
Player Damage Damage Cause Check the type of damage that was taken by the player.
Player Damage Damage Amount Check the amount of damage that was taken by the player.
Player Block Break Block Type Check that the type of block that has been broken matches the item provided.
Player Block Break Within Region Requires the location to be within the selected region. The appearance is the same as the regular condition, but the behaviour takes the position of the block instead of the player.
Player Drop Item

Player Pick Up Item Player Change Held Item

Is Item Requires the item for the event to match the required cases.