Cold Sweat
  • Temperature Basics
  • TempModifiers
  • List of TempModifiers
  • Block Temperature
  • Attributes
  • Tags
    • Item Tags
    • Block Tags
    • Dimension Type Tags
    • Potion Effect Tags
  • Datapacks
    • Datapack Basics
    • Requirements
      • Entity Requirement
      • Item Requirement
      • Block Requirement
      • NBT Requirement
      • Components Requirement
      • Location Requirement
    • Item Configs
    • Block/World Configs
    • Entity Configs
    • Registry Removals
  • KubeJS
    • KubeJS Basics
    • Registries
      • Block Temperature
  • Add-Ons
    • Origin Configs
  • Utility Classes
    • DynamicHolder
    • CapabilityCache
Powered by GitBook
On this page
  1. Datapacks
  2. Requirements

Block Requirement

PreviousItem RequirementNextNBT Requirement

Last updated 16 days ago

A block requirement is a set of criteria that a block must meet. They currently support checking:

  • Block IDs and tags

  • NBT (if the block is a )

  • If the block has solid faces on certain sides

  • If the block is replaceable

This requirement can also be negated, meaning everything that doesn't match the given checks passes.

Example:

{
  // List of blocks or block tags
  "blocks": [
    "minecraft:oak_planks",
    "#minecraft:wool"
  ],
  // List of blockstate checks (boolean, int, int range, enum, or list of enums)
  "state": {
    "lit": true,
    "age": 3,
    "power": {
      "min": 1,
      "max": 3
    },
    "type": "lower",
    "facing": [
      "north",
      "south"
    ]
  },
  // If the block is a tile entity, it must have NBT that matches this reqirement
  // This section does nothing for normal blocks
  "nbt": {
    "Powered": true,
    "EnergyLevel": "3.5-11.5",
    "InnerData": {
      "NestedTag": "some_value"
    }
  },
  // Checks if the given sides of the block are solid
  "sturdy_faces": [
    "up",
    "south"
  ],
  // Checks if the block is replaceable by the player or fluids
  "replaceable": false,
  // Inverts this requirement, so it passes if any of the checks fail
  "negate": false
}
block entity