User Tools

Site Tools


actions:start

Table of Contents

Actions

Actions, sometimes called world actions or action entries, execute something in the world that may affect item stacks, blocks or entities. These actions can be found in a data pack under the action folder in a namespace. When used in other places, actions can either be inlined or referenced by using its id instead.

The action itself is found in the action field. Optionally, an action entry can have requirements that it has to pass before executing the action at all.

Fields

Name Description Type Default Value
action The actual action to execute. An action
requirements The requirements to pass before executing the action. An optional action requirements

Example

{
  "action": {
    "type": "minecraft:sequence",
    "handler": "minecraft:passing",
    "entries": [
      {
        "action": {
          "type": "minecraft:set_block_state",
          "position": "target",
          "state": {
            "Name": "minecraft:dirt"
          }
        }
      },
      {
        "action": {
          "type": "minecraft:drop_item_from_block",
          "item": "minecraft:hanging_roots",
          "position": "target"
        }
      }
    ]
  },
  "requirements": {
    "context": {
      "entity": "this",
      "position": "target"
    },
    "conditions": {
      "condition": "minecraft:location_check",
      "predicate": {
        "block": {
          "blocks": "minecraft:rooted_dirt"
        }
      }
    }
  }
}
actions/start.txt · Last modified: 2024/05/07 16:22 by errorcraft