Skip to content

Remove Operation

EnderTurret edited this page Nov 5, 2024 · 1 revision

The remove patch type removes an element — plain and simple. It is arguably the simplest patch type (aside from compound patches.)

A remove patch looks like this:

{
  "op": "remove", // specifies this is a remove patch
  "path": "/path/to/removed/element", // specifies the path to the element which will be removed
}

For example, suppose you don't want people to be able to silk touch beehives:

// beehive.json.patch
{
  "op": "remove",
  "path": "/pools/0/entries/0/children/0"
}
// beehive.json (patched)
{
  "type": "minecraft:block",
  "pools": [
    {
      "bonus_rolls": 0.0,
      "entries": [
        {
          "type": "minecraft:alternatives",
          "children": [
            // { ... } // removed by file/NoSilkBees
            {
              // ...
            }
          ]
        }
      ]
    }
  ]
}

Clone this wiki locally