Expressions

Value-producing patterns that resolve to Java expressions.

138 patterns

Attribute

get %e:ENTITY_POSSESSIVE% %attr:ATTRIBUTE% [base] [value]
Attribute
1.0.0

Returns the base value of an attribute on a living entity, or 0 if the entity does not have the attribute.

Examples
set hp to mob's max_health
get %e:ENTITY_POSSESSIVE% %attr:ATTRIBUTE% (effective|total) [value]
Attribute
1.0.0

Returns the effective (total with modifiers) value of an attribute on a living entity, or 0 if the entity does not have the attribute.

Examples
set totalHp to mob's max_health effective
get %e:ENTITY_POSSESSIVE% %attr:ATTRIBUTE% default [value]
Attribute
1.0.0

Returns the default value of an attribute on a living entity, or 0 if the entity does not have the attribute.

Examples
set defaultHp to mob's max_health default

Block

[get] block at %loc:LOCATION%
Block
1.0.0

Returns the block at a given location.

Examples
set b to block at loc
[get] %b:BLOCK% type
Block
1.0.0

Returns the material name of a block's type.

Examples
set t to block type
[get] %b:BLOCK% location
Block
1.0.0

Returns the location of a block.

Examples
set loc to block location
[get] %b:BLOCK% world
Block
1.0.0

Returns the world the block is in.

Examples
set w to block world
[get] %b:BLOCK% (x|y|z)
Block
1.0.0

Returns the x, y, or z coordinate of a block.

Examples
set x to block x
[get] %b:BLOCK% light level
Block
1.0.0

Returns the light level at a block's location.

Examples
set light to block light level
[get] %b:BLOCK% data [string]
Block
1.0.0

Returns the block data as a string representation.

Examples
set data to block data

Data

new %body:EXPR%
Data
1.0.0

Creates a new data instance. Use 'with' to set fields: new arena with name "x" x1 5

Examples
set a to new arena
set a to new arena with name "PvP" x1 0 y1 0 z1 0 x2 100 y2 100 z2 100
get field %field:STRING% (of|from) %obj:EXPR%
Data
1.0.0

Gets a field value from a data instance.

Examples
set name to get field "name" of myArena
set x to get field "x1" from myArena
%obj:EXPR% field [of] %field:STRING%
Data
1.0.0

Gets a field value from a data instance using postfix syntax.

Examples
set name to myArena field "name"

Location

new location in %w:WORLD% at %x:INT% %y:INT% %z:INT%
Location
1.0.0

Creates a new Location from a world and XYZ coordinates.

Examples
set loc to new location in myWorld at 100 64 -200
new location at %x:INT% %y:INT% %z:INT% in %w:WORLD%
Location
1.0.0

Creates a new Location from XYZ coordinates and a world.

Examples
set loc to new location at 100 64 -200 in myWorld