Entity Properties
This is the full reference of elements that can be used inside the Entity
element to
fully define an entity.
Basic Metadata
ID
Integer, required
<ID>someNumber</ID>
Described in the introduction to entities. Note that the game uses some ID to identify each block type internally, this is not the same ID. In fact, the internal ID used to identify modded entities may change across different runs of the game or even while the game is running, so don't rely on it for anything.
Name
String, required
<Name>Some Entity Name</Name>
Name of the entity, to be displayed in the user interface.
Category
Category, required
<Category>Virtual</Category>
In which category the entity should be displayed in the level editor UI.
Available categories are Buildings
, Brick
, Animals
, Humans
, Weaponry
,
EnvironmentFoliage
, Primitives
, Weather
, and Virtual
.
Scale
Scale, optional
<Scale canScale="true" uniformScale="false" />
Specifies how the level editor scale tool should treat the entity. If not specified, the default is as in the example above.
CanPick
Boolean, optional
<CanPick>True</CanPick>
Specifies if the entity can be picked in events that act on entities (e.g. Activate).
Default is True
, only set this to False
with a good reason as it may break player
expectations.
ShowPhysicsToggle
Boolean, optional
<CanPick>True</CanPick>
Specifies whether to show the Physics toggle in the properties of the entity.
Disable it if the entity can't/shouldn't respond to any physics.
Default is True
.
Offset
Vector3, optional
<Offset x="0" y="0" z="0" />
Can be used to specify a placement offset for the entity.
Fallback
EntityType, optional
<Fallback>Cottage</Fallback>
Normally, when a level with a modded entity is loaded, but that entity is not loaded, the entity will be ignored. If the entity has a fallback specified here, the fallback entity is loaded instead in this scenario.
Valid values are numeric entity IDs or the name of an entity, as returned by the .Name property of the Entity class. Only normal entities can be specified as fallbacks, not modded entities.
Visuals
Mesh
Mesh, required
<Mesh name="some-mesh-name" />
Mesh/Model of the entity.
See Common Elements for a guide on how Mesh
elements can be used.
Texture
Texture, required
<Texture name="some-texture-name" />
Texture of the entity.
See Common Elements for a guide on how Texture
elements can be used.
Icon
Texture, required
<Icon name="some-icon-texture-name" />
Unlike the 3D models used for blocks, the game uses pre-rendered textures for display in the level editor UI. Also unlike for blocks, the game is not currently able to generate these textures automatically. Use this to specify the texture to display.
Icon
is a texture element, see Common Elements for a guide on
these elements can be used.
In-Game Behaviour
Colliders
Collider[], required
<Colliders>...</Colliders>
The colliders of the entity. A list of Collider
elements.
See Common Elements for a guide on how to use Collider
elements.
FireInteraction
FireInteraction, optional
<FireInteraction burnDuration="5">
...
</FireInteraction>
Including this element makes it possible for the entity to catch fire.
See Common Elements for a guide on how to use FireInteraction
elements.
Triggers
Trigger[], optional
<Triggers>
<Trigger>LevelStart</Trigger>
<ModdedTrigger>
<ModID>someModId</ModID>
<LocalID>someId</LocalID>
</ModdedTrigger>
</Triggers>
Include to manually specify what triggers can be used on the entity.
The Trigger
element is used to enable official triggers. Available triggers are
LevelStart
, Activate
, Deactivate
, Destroy
, Ignite
, Variable
, Death
,
and Explode
.
The ModdedTrigger
element is used to enable additional modded triggers, by specifying
the ID of the mod that adds them as well as the ID of the trigger within that mod.
A modded trigger can be enabled either by including it here or by specifying the entity
in the trigger declaration. Either one is enough to enable the trigger.
It is possible to omit the ModID
element when the trigger is in the same mod as the entity.
You should almost always include the LevelStart
, Activate
, Deactivate
and Variable
triggers, otherwise the player may feel unnecessarily limited. These are also the default
if the Triggers
element is not included.
Destructible
Include a Destructible
element to make the entity destructible.
The Destructible
element has one attribute, forceToBreak
(Integer) which specifies how
much force is needed to break the entity.
The Destructible
element has various child elements to specify how the entity should
break apart. These are described below.
See Reference Values for sample values for the various force involved.
BreakForce
BreakForce, optional
<BreakForce power="200" radius="6" />
Specify what force the the entity applies to surrounding objects when breaking. Default is 200, 6.
Sound
Sound, optional
<Sound name="some-breaking-sound-name" />
Specify what sound to play when entity breaks. Default is the sound of the cottage breaking.
Particles
Particle[], required
<Particles>
...
</Particles>
A list of particles, which are the objects an entity breaks into when it is destroyed.
Each Particle
child element is defined as follows.
Particle
<Particle>
<Mesh name="some-particle-mesh-name" />
<Colliders> .... </Colliders>
</Particle>
Child elements are self explanatory. See Common Elements on how to use them. The particles will inherit the texture of the entity itself, so make sure this is reflected in the UV mapping of the meshes.
Misc. Elements
Debug
Boolean, optional
<Debug>False</Debug>
Enables debug mode for this entity. In debug mode, colliders are shown visually in-game to assist in placing them correctly.