Skip to content

Examples

Redheris edited this page Nov 3, 2026 · 1 revision

Helpful for understanding configs

These configs should help you understand the syntax and how to start creating your own configs.

Basic usage
name: Example config's name
# YAML syntax

# A comment line starts with # character
placeBlock:
  - item: obsidian # Prevents placing obsidian blocks
  - item: "#logs"  # Prevent placing any blocks with vanilla #logs tag
  - item: [grass_block, "#c:natural_logs"] # Prevents placing grass blocks and
                                           # any blocks with #c:natural_logs tag
                                           # (example tag providing by Fabric API)
attackBlock:
  - y<=: 60 # Prevents attacking/destroying blocks below Y = 61

attackEntity:
  - entity: villager # Prevent attacking villagers

useItem:
  - item: poisonous_potato    # Prevents eating a poisonous potato
  - item: "##blacklist_items" # Prevents using items from the "blacklist_items" custom tag
Logical operators usage
name: Logical operators

attackBlock:
  # AND condition is met if every nested condition is met
  - and:
      - block: netherrack # Destroying a netherrack block
      - x: -64..63 # X is between -64 and 63
      - y: -60 # Y is -60
      - z: -65 # Z is -65

attackEntity:
  # Categories themselves represent an OR condition,
  # so the OR usage in this example makes no different
  #
  # OR condition is met if at least one of the nested conditions is met
  - or:
      - entity: villager
      - item: stone_shovel

placeBlock:
  # NOT condition is met if the nested conditions is not met
  - not: # Allows only placing leaves blocks 
      item: "#leaves"
Complex logical structures
name: Complex logical structures

attackBlock:
  # Since logical conditions are still conditions, they can be nested
  # into each other making complex conditions
  #
  # Prevents destroying glass blocks without silk touch enchantment
  - and:
      - block: "#c:glass_blocks"
      - not:
          enchant: silk_touch

placeBlock:
  # Prevents placing block in the overworld beyond the XZ [64,64]-[191,191]
  - and:
      - dimension: overworld
      - not:
          and:
            - x: 64..191
            - z: 64..191

attackEntity:
  # Prevent attacking a cow in the overworld with any item or
  # in any other dimension with a stone sword or diamond axe
  - and:
      - entity: cow
      - or:
          - item: [stone_sword, diamond_axe] 
          - dimension: overworld
Condition values types
name: Condition value types

# There are a few value types conditions may use
attackAny:
  # String
  - item: stick # Vanilla identifier ("value" = "minecraft:value")
  - customName: "Excalibur"
  # Full identifier (visible with F3 + H in the inventory and with F3 in the world)
  - item: "example:my_item"
  # Vanilla tag (e.g. visible with F3 for block)
  - item: "#shovels"
  # Custom tag
  - block: "##my_favorite_blocks"
  # List of values. Usually works as simplified OR
  - block: [stone, "#dirt", "##my_custom_tag", redstone_torch]
  - block:
      - stone
      - "#dirt"
      - "##my_custom_tag"
      - redstone_torch
  # Parametrized. Such values can consist of one or several "key:value" pairs.
  # See the condition's description and examples on the Conditions List page
  - not:
      block: stone
  - enchant:
      id: fortune
      level: 3
  - customName:
      regex: true
      name: ".*\b[eE]vent\b.*"

Practical and useful configs

These configs may be practically useful for someone. You can use them and adjust to your specific needs

No bed interactions
name: No bed interactions

interactBlock:
  - block: "#beds"
Mapart building
name: Mapart building

attackBlock:
  # Prevents destroying your mapart platform along with blocks of the mapart
  - and:
      - dimension: the_end
      # Platform's area coordinates
      - x: -64..63
      - y: 50
      - z: -64..63
  - and:
      - dimension: the_end
      # Platform's noobline coordinates
      - x: -64..63
      - y: 51
      - z: -65

placeBlock:
  # Prevents placing blocks at the second layer when building a 2D mapart
  - and:
      - dimension: the_end
      # Platform's coordinates
      - x: -64..63
      - y: 52
      - z: -64..63
No stripping wood and making dirt paths
name: No stripping wood and dirt paths

interactBlock:
  # Prevents stripping logs and wood
  - and:
      - item: "#axes"
      # FAPI on 1.21.1 and 1.21.4 doesn't have these tags, so you can simply use #logs
      - block: ["#c:natural_logs", "#c:natural_woods"]
  # Prevents making dirt paths
  - and:
      - item: "#shovels"
      - block: [grass_block, "#dirt"]
Prevent double slabs
name: No double slabs and waterlogged

placeBlock:
  # Prevents placing double slabs
  - and:
      - item: "#slabs"
      - block: "#slabs" # block condition here checks the block at the
                        # placing position, so it check placing inside a block
  # Prevents waterlogging blocks
  - and:
      - item: ["#c:buckets/water", "#c:buckets/entity_water"]
      - blockState:
          waterlogged: false
Don't waste glass blocks
name: Safe glass blocks

attackBlock:
  # Prevent destroying glass without silk touch enchantment
  - and:
      - not:
          block: tinted_glass
      - block: ["#c:glass_blocks", "#c:glass_panes"]
      - not:
          enchant: silk_touch
Harvest only ripe crops
name: Safe harvesting

attackBlock:
  # Prevents destroying farmland blocks
  - block: farmland
  # Allows only destroying ripe crops
  - block: [torchflower_crop, pumpkin_stem, melon_stem]
  - and:
      - block: cocoa
      - blockState:
          age: [0, 1]
  - and:
      - block: [beetroots, nether_wart]
      - not:
          blockState:
            age: 3
  - and:
      - block: pitcher_crop
      - not:
          blockState:
            age: 4
  - and:
      - block: [carrots, potatoes, wheat]
      - not:
          blockState:
            age: 7
  # Prevents destroying the most bottom sugarcane
  - and:
      - block: sugar_cane
      - not:
          blockBelow: sugar_cane

Clone this wiki locally