Skip to main content
← Back

Cobblemon Moving Platform NPCs

An autonomous Cobblemon NPC that moves along a configured path through the world on its own schedule. Players stand on it, ride along, and step off whenever they want. It builds on the same solid-block-lift-and-place trick the Puzzle Rock uses, but is driven by a tick loop instead of player interaction. The intended use is to transport the player across gaps or to be activated/deactivated as part of a puzzle.

What it does

The NPC comes in two sizes: a 1x1x1 single block and a 2x1x2 wide platform. Both follow the same logic:

  • Waypoint path: path_waypoints is a semicolon-separated string of absolute world coordinates. Example: "100,64,200;110,64,200;110,64,210". The platform steps toward the current waypoint at path_tick_interval (default every 10 ticks), pauses for path_pause_at_waypoint_ticks on arrival, then advances.
  • Loop modes: loop (wrap to start), pingpong (reverse direction at ends), or once (stop at last waypoint).
  • Per-step shape: multi-axis paths interpolate diagonally instead of stepping one axis at a time. A path from (0,0,0) to (5,5,5) takes 5 steps rather than 15.
  • Activation radius: path_player_radius (default 32) gates ticking on whether at least one player is nearby.
  • Pause condition: path_paused_condition is a Molang gate string. If it evaluates v.result = true, the platform skips the tick. This is the hook for redstone-controlled stops, quest gating, or scoreboard-based pauses.
  • Blocked behaviour: when the next position is obstructed, wait (stop until clear) or skip (advance to the next waypoint).
  • On-waypoint callbacks: on_waypoint_command and on_waypoint_script, both with a {{waypoint_index}} placeholder, fire each time the platform arrives. Useful for triggering doors or puzzle elements, playing a sound at a stop, or even activating another platform.

A reset interaction is built in. A perm-and-item-gated right-click sends the platform back to spawn and resets the waypoint index. Optional on_reset_command and on_reset_script hooks fire alongside.

Use cases

  • Elevators: vertical 2-waypoint path, pingpong mode, a pause_at_waypoint_ticks long enough for a player to step off, with on_waypoint_command opening the floor door.
  • Conveyor floors: long horizontal path with is_wide on, a fast tick interval, and a loop. Players ride from one side of a room to the other.
  • Cutscene rails: once mode with on_waypoint_command triggers at each beat. The platform delivers the player to a vantage point and then fires the scripted event when it arrives.
  • Sokoban-style ferries: is_solid true plus a redstone-gated pause condition lets a player operate the platform from a switch elsewhere in the puzzle.

How players actually ride it

This was the part that took the most iteration. The NPC itself is not solid, and instead relies on placing solid blocks at its next position to hold the player up. A player who knows this and is quick enough could just keep walking forward to be on the platform all the time, but one wrong move would cause them to appear to fall through the NPC. I tried two alternatives: teleporting the player with the NPC, or applying velocity to the player with Journey's q.player.push.

Teleporting worked, but felt very jarring. The player could not freely move about the top of the platform, as the platform continually reset their position and even their camera rotation. This made it quite difficult to look around or leave the platform in the direction you wished. I found pushing to be much more comfortable. You can look around and walk in any direction on the platform because the velocity from q.player.push is additive to your existing velocity. If you time it right, you can even jump forward and get a boost from the push!

As such, the platform pushes the player via q.player.push in the direction of platform travel each step instead of teleporting them. path_rider_push_strength is tunable so per-step drift roughly matches the platform's per-step distance. Care should be taken with this value, since pushing too hard causes the player to slide off and pushing too softly causes the platform to leave them behind.

Techy Stuff

  • Built on Cobblemon's NPC, behaviour, and Molang systems, configured in JSON.
  • Tick loop runs as an add_tasks_to_activity task on minecraft:idle priority 0. The activation radius and tick interval are enforced inside the script rather than via Minecraft's brain priorities.
  • Solid-block management reuses the cobblemon:get_block_on_npc and cobblemon:set_block_on_npc helpers from the puzzle rock, extended with an is_wide branch alongside the existing pillar branch. As such, all three footprints (cube, pillar, wide) share one code path.
  • Waypoint string parsing is cached in q.entity.data and only re-parsed when the config string changes. The tick loop does not re-tokenize every tick.
  • Models and textures built in Blockbench. Presets ship for the most common shapes so a server owner can drop one in without modeling.

Built for the Callisto and Cobblewilds Cobblemon servers, but available for commission.