Skip to content

Read Packets

Sleys edited this page Sep 13, 2026 · 1 revision

Reading a Data Packet means evaluating a stored value on an entity against an expected one, using a comparator appropriate to its type. It's always used as a condition.

This page only covers the read_data object itself:

"read_data": {
  "AND": [
    {
      "type": "int", "dataId": "my_sword.air_slash.executed.count",
      "comparator": "greater_equal", "value": 3, "delete": true
    }
  ]
}

🧩 Group Structure

read_data is split into four lists AND, OR, XOR, NOT each holding zero or more conditions like the one above. See Data Packets for how the four groups combine into a single pass/fail result; this page focuses on what goes inside one condition entry.


📋 Fields

Field Type Description
type String The kind of value stored under dataId. Determines which comparators are valid and how value/max/min are interpreted.
dataId String The key the value is read from on the entity. Must match the dataId it was written under.
comparator String How to evaluate the stored value. Not used for bool (see below).
value Number / String The value to compare against. Used by every comparator except the *_RANGE family.
max / min Number Used instead of value by the *_RANGE comparators.
expected Boolean Used instead of comparator/value for bool the value the stored boolean must equal.
delete Boolean If the condition passes, removes the stored data as a side effect of reading it. Optional, defaults to false.

🔢 Numeric Comparators (int, long, float, double, byte)

Comparator Passes when
EQUALS stored value == value
NOT_EQUALS stored value != value
GREATER_THAN stored value > value
GREATER_EQUAL stored value >= value
LESS_THAN stored value < value
LESS_EQUAL stored value <= value
IN_RANGE min < stored value < max (both bounds excluded)
INCLUSIVE_LOWER_RANGE min <= stored value < max (lower bound included)
INCLUSIVE_UPPER_RANGE min < stored value <= max (upper bound included)
INCLUSIVE_RANGE min <= stored value <= max (both bounds included)

In the example, "comparator": "greater_equal", "value": 3 passes once my_sword.air_slash.executed.count reaches 3 or more.


🔤 String Comparator (string)

Comparator Passes when
EQUALS stored value equals value exactly
CONTAINS stored value contains value as a substring

✅ Boolean (bool)

Booleans don't use a comparator at all the condition passes when the stored value equals expected:

{ "type": "bool", "dataId": "my_sword.air_slash.executed", "expected": true }

🗑️ delete

delete removes the data the moment the condition passes useful for one-shot conditions (like the air-slash counter above, which resets itself after triggering).

Where the removal actually happens depends on whether the read is local or synced, same as writes:

  • Local read the data is removed only from the side that evaluated it.
  • Synced read the removal is propagated to both sides, same as a synced write.

⚠️ Notes

  • type must match whatever the data was written as comparing an int value against data that was written as a string will not work correctly.
  • Mixing value with max/min on the same entry isn't meaningful only the *_RANGE comparators use max/min; every other comparator uses value.
  • An empty AND/NOT list is treated as passing for that group; an empty OR/XOR list is also treated as passing only a non-empty list is actually evaluated.

EF: Extended Datapacks

📦 Data

🧰 Core

👁️ Visuals

⚔️ Combat

🗝️ Skill Builder

🛠️ Innate Builder

🗡️ Animation Operations

⚙️ Third-Party

Clone this wiki locally