Skip to main content

Attach Rope (Bi-Entity Action Type)

Attaches a rope between the actor and the target. It is the same action as the entity action apoli:attach_rope, registered again here so an endpoint can use "source": "target".

Type ID: apoli:attach_rope

Fields

FieldTypeDefaultDescription
fromRope Endpoint{ "source": "self" }One end of the rope. self is the actor.
toRope Endpoint{ "source": "raycast", "blocks": true }The other end. Use { "source": "target" } for the entity this action runs against.
slotStringoptionalA label for this rope. Attaching again with the same slot replaces the rope already in it.
textureIdentifierapoli:textures/rope/rope.pngThe texture the rope is drawn with.
toggleBooleantrueWith true and no slot, firing again while the actor already holds a controllable rope releases it instead of adding another.
controllableBooleantrueWhether the built-in reel and swing keys drive this rope for its owner. Set it to false for tethers you cast on other entities.
modeString"leash"leash, spring or rigid. See the entity action page.
break_beyondFloat0.0Snaps the rope once its ends are more than this many blocks apart. 0 never breaks.
min_lengthFloat1.0The shortest the rope can reel to.
max_lengthFloat30.0The longest the rope can be.
start_lengthFloatsee descriptionThe length the rope starts at, clamped between min_length and max_length. Left out, a controllable rope starts taut at the current distance between its ends, and a rope that isn't controllable starts at max_length.
stiffnessFloat0.1How hard the rope yanks an end back once it passes its length. Range 0.0 to 1.0.
radial_dampingFloat0.85How much outward speed is taken away at the length limit. Range 0.0 to 1.0. It is a damping factor, so above 1.0 it would amplify instead.
spring_scalingFloat0.65Extra softening while swinging inward. Range 0.0 to 1.0.
swing_boostFloat1.08A speed multiplier applied to a sprinting player's swing. Range 0.0 to 2.0.
max_swing_speedFloat0.7The cap on the sprint swing boost.
control_accelFloat0.08How hard the WASD swing keys push a controllable rope.
reel_stepFloat0.2Blocks per tick the length changes while a reel key is held.
slack_pull_rateFloat5.0A multiplier applied to reeling in while there is slack.
constrain_fromBooleantrueWhether the physics may pull the from end.
constrain_toBooleantrueWhether the physics may pull the to end.
warning

The physics fields are clamped to a stable range when the pack loads, and a value outside it is clamped with a warning naming the field. stiffness, radial_damping and spring_scaling must be between 0.0 and 1.0, and swing_boost between 0.0 and 2.0. Above those, the spring calculation that runs every tick grows instead of settling: radial_damping above 1.0 multiplies outward speed every tick, and stiffness above 1.0 overshoots further with each correction, which can throw players hundreds of blocks. The rope also never applies more than 4 blocks per tick of correction, so no combination of settings can launch an endpoint across the world.

note

Physics settings are read when the rope is cast. Editing them and reloading the data pack doesn't change ropes that already exist, so cast the rope again to pick up new values.

Example

{
  "type": "apoli:attach_rope",
  "to": { "source": "target" },
  "slot": "whip",
  "controllable": false,
  "max_length": 6,
  "break_beyond": 14
}

A whip that hooks whatever you hit and drags it along within 6 blocks, until the two of you are pulled 14 blocks apart. It isn't controllable, so it starts at its full 6-block length.