Skip to main content

Rift Presets (rift)

File location: data/<namespace>/mxt/rift/<path>.json

Presets provide shape and appearance for commands and Secret Realm Tokens. The creation entry supplies position and destination. Built-in presets are mxt:default and mxt:rectangle.

FieldTypeDefaultDescription
shapeObjectrequiredvertices contains local [u, v] pairs.
appearanceObjectdefault appearanceSee below.

Shape​

vertices follows a closed outline; do not repeat the first point at the end. Use 3–128 points, at most 32 blocks of span on either local axis, with each coordinate’s absolute value at most 1024. Self-intersection, overlapping edges, duplicate points, zero-length edges and degenerate area are rejected. Intermediate points on a straight edge may be retained for editing, but edges cannot double back and overlap. Concave outlines and reversed winding are supported; holes are not. The server may lower the vertex cap.

{
"shape": {"vertices": [[-1, 0], [1, 0], [1, 2.5], [-1, 2.5]]},
"appearance": {"style": "portal", "color": -1, "edge_width": 0.06}
}

Appearance​

FieldTypeDefaultDescription
styleStringriftrift or portal.
colorInteger-1Primary colour; -1 derives it from the destination identity.
edge_colorInteger-1Edge colour; -1 brightens the primary colour.
speedDouble 0..101Surface texture speed.
edge_widthDouble 0..0.50.06Edge width in local coordinates.
glowDouble 0..10.2Soft interior edge glow strength.
particlesDouble 0..10.1Client edge particle density within a per-tick budget.
texture_scaleDouble 0.01..1001Texture scale.
texture_rotationDouble -360..3600Texture rotation in degrees.
texture_uDouble -1024..10240Horizontal texture offset.
texture_vDouble -1024..10240Vertical texture offset.

The surface is opaque. Glow is not scene bloom, and particles do not affect travel. Disabling the custom shader selects a solid-colour surface.

Portal Templates and Realm Layouts​

The secret_realm portals array contains templates directly rather than preset ids. The editor exports designed portals in this format.

FieldTypeDefaultDescription
keyString 1..64requiredUnique within the layout.
placementObjectrequiredThree 3D vectors: origin, normal, tangent.
relative_to_entryBooleanfalseWhether origin is relative to the instance entrance.
shapeObjectrequiredSame as presets.
destinationObjectrequiredSee below.
appearanceObjectdefault appearanceSame as presets.
duration_ticksNonnegative Long0Portal lifetime; 0 is permanent.
enabledBooleantrueWhether travel is enabled.

normal and tangent must be nonzero and nonparallel; they are orthonormalized on loading. World positions are origin + tangent*u + (normal × tangent)*v. Template vertices must fit the dimension’s height and border.

Destination type selects:

typeFieldsRule
positionRequired pos; optional dimension, yaw, pitch; nearby defaults to falseMissing dimension means the containing instance. Pitch is -90..90; nearby permits a safe search up to 4 blocks.
secret_realmRequired realmRealm definition id; first successful entry binds an instance.
returnnoneThe entity’s saved realm entry origin.

Travel searches existing safe positions first. If none is found, it tries a single dirt layer in empty space, usually 3×3 for a player and larger for bigger entities with a one-block margin. The platform cannot replace blocks, remove fluids or obstructions, cross the world border or occupy other entities. When building, foot height rounds upward to an integer and stays at least one block above the world's minimum height. nearby=false tries only the original location with that height adjustment; true permits further attempts at offsets up to 4 blocks along each axis. Travel is refused if a safe landing is still unavailable.

{
"portals": [{
"key": "exit",
"placement": {"origin": [3, 0, 0], "normal": [0, 0, 1], "tangent": [1, 0, 0]},
"relative_to_entry": true,
"shape": {"vertices": [[-1, 0], [1, 0], [1, 2.5], [-1, 2.5]]},
"destination": {"type": "return"},
"duration_ticks": 0
}]
}

A layout holds up to 128 portals. All entries are validated before publishing, after structures and the entrance are prepared. Installation only happens on the first preparation; reopening a prepared instance does not restore removed or expired portals.