-
-
Notifications
You must be signed in to change notification settings - Fork 15
Properties
Shane Bee edited this page Mar 17, 2025
·
9 revisions
Properties are simplied versions of full expression, which are used in the Property Expression
Table of contents:
Properties which can be used on Entity
- Description: Represents the health of an entity.
- Return Type: number
- Change Modes: add, set, remove, reset
- Since: 3.10.0
- Examples:
set {_h} to health property of player
set health property of player to 10
add 1 to health property of player
remove 1 from health property of target entity
- Description: Represents the name of an entity.
- Return Type: text
- Change Modes: set, delete/clear
- Since: 3.10.0
Properties which can be used on InventoryHolder
- Description: Represents the contents of an object that holds an inventory.
- Return Type: item type
- Change Modes: add, set, remove, delete/clear
- Since: 3.10.0
- Examples:
set {_i::*} to inventory contents property of player
add an apple to inventory contents property of player
remove all diamonds from inventory contents property of player
Properties which can be used on Item Type
- Description: Represents the blast resistance of a block.
- Return Type: number
- Change Modes: Cannot be changed
- Since: 3.10.0
- Examples:
if blast resistance property of target block > 1:
- Description: Represents if an item is fire resistant. If true, it will not burn in fire or lava.
- Return Type: boolean (yes/no)
- Change Modes: set
- Since: 3.10.0
- Examples:
set fire resistant property of {_i} to true
-
Description: Represents the different item rarities of an item (represented as a string).
Options are: "common", "uncommon", "rare", "epic"
Requires MC 1.20.5+ - Return Type: text
- Change Modes: set, delete/clear
- Since: 3.10.0
- Examples:
set item rarity property of player's tool to "uncommon"
set {_rarity} to item rarity property of player's tool
if item rarity property of player's tool = "epic":
- Description: Represents if the item is unbreakable.
- Return Type: boolean (yes/no)
- Change Modes: set
- Since: 3.10.0
- Examples:
set unbreakable property of player's tool to true
set unbreakable property of player's tool to false
Properties which can be used on Living Entity
-
Description: Prevent mobs from despawning naturally.
See the Despawning section McWiki for further details about despawning.
A silly side effect of this is that some mobs (such as sheep) will stop their random stroll goal when more than 32 blocks away from a player, setting this to true will prevent that and the mob will forever roam the lands. - Return Type: boolean (yes/no)
- Change Modes: set
- Since: 3.10.0
- Examples:
set persistence required property of all mobs to true
- Description: Whether the mob is aggressive. This will not work on all mobs, only mobs that can actually be aggressive.
- Return Type: boolean (yes/no)
- Change Modes: set
- Since: 3.10.0
- Examples:
set aggressive property of event-mob to true
Properties which can be used on Player
-
Description: Represents the "Score" the player sees in their death screen.
Requires Paper 1.21.4+ - Return Type: integer
- Change Modes: set
- Since: 3.10.0
- Examples:
set {_score} to death screen score property of player
set death screen score property of player to 150
- Description: Whether an entity is sitting. Currently supports Camel, Cat, Fox, Panda, Parrot, Wolf.
- Return Type: boolean (yes/no)
- Change Modes: set
- Since: 3.10.0
- Examples:
set sitting property of target entity to true
if sitting property of event-mob is false: