Entity Properties

If you are unsure how to use these object functions, check out the entity properties tutorial.

Any entity property ending with [&triggers] may have an optional string of game triggers appended to them to execute alongside the function. See Triggers for more information.

name.path
name.path(path)

Defines a path for the entity to follow.

path (path)

Entity’s path.

Default: None

name.speed
name.speed(speed)

Defines the entity’s walking speed.

speed (number)

Percentage of normal speed. Use 50 for half speed, or use 200 for double speed.

Default: 100

name.shadow
name.shadow([state])

Sets whether the entity has a shadow or not.

state (0/1)

Should the entity have a shadow?

Default: 0 for sprites, 1 for NPCs

name.solid
name.solid([state])

Sets where the entity is solid or not.

state (0/1)

Should the entity be solid?

Default: 0 for sprites, 1 for NPCs

name.ignore
name.ignore()

Sets whether the entity should ignore the player, by not changing direction, when the player interacts with it.

name.float
name.float([height])

Sets the entity’s floating height.

height (number)

Floating height in pixels.

Default: 0

name.color
name.color([color])

Sets the entity’s color.

color (rgb)

The color to mask the entity with.

Default: Entity completely ignores lighting effects

name.nametag
name.nametag()

Gives the entity a nametag.

name.print
name.print(type)

Creates a fading trail behind the target.

type (string)

Type of trail to draw.

Default: No trail

name.outline
name.outline([color])

Draws a colored outline around the target.

color (rgb)

Color of outline.

Default: Removes outline

name.ally
name.ally(ally1 [ally2 [ally3...]])

Sets the target’s allies, or following entities.

ally (skin)

Overworld skin of following ally. For multiple allies, separate with spaces.

name.skincolor
name.skincolor(id)

Sets the target’s skin color.

id (number)

Skin color ID to change to.

Default: 0

name.persistent
name.persistent()

By default, entities are destroyed when the player leaves the map or reloads the map. Persistent entities will persist.

name.spot
name.spot(tiles[,change_path[,spot_through_walls[,move_to_spotted]]])

Allows the entity to spot the player and initiate an interaction.

tiles (number)

Radius, in all directions, the player must be in to be spotted.

change_path (0/1)

Should the NPC stop their path after spotting the player? If not, the entity will keep moving after spotting the player.

Default: 1

spot_through_walls (0/1)

Can the entity spot the player through walls?

Default: 0

move_to_spotted (0/1)

Should the entity move to the player after spotting?

Default: 1

name.opacity
name.opacity(opacity)

Sets the entity’s opacity.

opacity (percentage)

The opacity as a percentage. Use 100 for 100%, or use 50 for 50%.

name.xy
name.xy(x,y)

Offsets the display position of the object.

x (number)

Horizontal offset in pixels.

y (number)

Vertical offset in pixels.

name.depth
name.depth(depth)

Sets the relative depth of the entity.

depth (number | depth)

Depth of the sprite. If a number is given, it works like depth+n.

name.spin
name.spin()

Causes the object to spin.