Skip to content

Datapacks and commands

Adam Hunt edited this page Nov 19, 2026 · 1 revision

Field Emitters includes two presets you can apply to an existing field. They work on all five 1.4.0 builds. You need operator permission level 2 to run the commands.

Try the built-in tripwire

  1. Stand beside a powered field. Make a note of the base block's X, Y and Z coordinates. Choose a field you can change because applying a preset changes its network settings.
  2. Run /fieldemitters presets to list the available presets. Use your base coordinates in place of 0 64 0 below.
  3. Run /fieldemitters apply 0 64 0 fieldemitters:smart_tripwire. This preset opens the barrier to passage and selects crossing pulses on a fresh field.
  4. Walk across and run /fieldemitters status 0 64 0. Check the crossing count. To connect a lamp, see Sensors and redstone.
  5. To use a hostile-mob wall instead, apply fieldemitters:hostile_barrier.

Add a preset to your datapack

In an existing datapack, save the following file at data/workshop/fieldemitters/presets/blue_gate.json. This example changes only the color and the enabled switch. It keeps the network's filters.

{
  "color": "#4579FF",
  "enabled": true
}

Run /reload, then /fieldemitters apply 0 64 0 workshop:blue_gate. Open the tuner and check the color. Reapply a preset after editing its file if you want the edits on an existing field. To build a preset from a field you already configured, /fieldemitters export 0 64 0 prints its settings as JSON.

A pack can set "locked": true to keep the field's settings fixed. An operator can reopen editing with /fieldemitters unlock 0 64 0.

KubeJS

On NeoForge 1.21.1, Forge 1.20.1 and Fabric 1.20.1, the optional KubeJS integration can react to a completed crossing, contraband, power changes and passage decisions. Put scripts in kubejs/server_scripts/. Use the crossing event for something that should happen once per crossing. A passage decision can run repeatedly as an entity approaches.

The repository reference includes the filter JSON format, command results, compatible KubeJS builds and complete server script examples. Datapack and KubeJS reference

Clone this wiki locally