Show / Hide Table of Contents

Common XML Elements

Reference for various element types that are used in multiple different places.

Resource References

Mesh

<Mesh name="some-mesh-name">
    <Position x="0" y="0" z="0" />
    <Rotation x="0" y="0" z="0" />
    <Scale x="1" y="1" z="1" />
</Mesh>

The name attribute specifies what mesh to use. It must correspond to the name of a Mesh declaration in the Resources element of the mod manifest.

The child elements are all optional and can be used to adjust the mesh on a case-by-case basis.

See Resource Handling for more details.

Texture

<Texture name="some-texture-name" />

The name attributes specifies what texture to use. It must correspond to the name of a Texture declaration in the Resources element of the mod manifest.

See Resource Handling for more details.

Colliders

A Collider can be a BoxCollider, SphereCollider, or CapsuleCollider element. On all of these collider types, there are three optional attributes:

  • trigger (Boolean): Make this collider a trigger.
  • layer (Integer): Specify what layer to place this collider on.
  • ignoreForGhost (Boolean): Don't include this collider on the ghost of a block. (Only valid on colliders inside Block/Colliders.)

They also all have an optional Position child element.

BoxCollider

<BoxCollider>
    <Rotation x="0" y="0" z="0" />
    <Scale x="1" y="1" z="1" />
</BoxCollider>

SphereCollider

<SphereCollider>
    <Radius>1</Radius>
</SphereCollider>

CapsuleCollider

<CapsuleCollider>
    <Rotation x="0" y="0" z="0" />
    <Capsule direction="X" radius="1.0" height="2.0" />
</CapsuleCollider>

The Capsule element specifies the shape of the capsule:

  • direction can be X, Y, or Z
  • radius and height determine the size of the collider

Note that when debug visuals are turned on, capsule colliders are displayed the same as box colliders due to internal restrictions. Just imagine rounded off corners and edges.

FireInteraction

<FireInteraction burnDuration="5" igniteOnStart="false">
    <SphereTrigger>
        <Position x="0" y="0" z="0.91" />
        <Radius>1.52</Radius>>
    </SphereTrigger>
</FireInteraction>
  • burnDuration (Float): How long until the block/entity is burnt out.
  • igniteOnStart (Bool) (optional): Whether the object starts on fire. Can be used to for example emulate the Fireball by automatically igniting and setting a very long burn duration. Default: False.
  • SphereTrigger (optional): Manually specify the fire trigger. The fire trigger is a collider that determines how fire spreads from an object: When an object is burning, every other burnable object that is inside the fire trigger will also catch fire after a short time. The default trigger is shown above. You can also specify BoxTrigger but only one trigger at a time. The layer and trigger attributes have no effect here, they are always set automatically.
Back to top Generated by DocFX