Skip to content

Condition Configs

Redheris edited this page Nov 3, 2026 · 1 revision

Condition config files

All condition config files must be in the configs/preventbuild/conditions folder and have the .yml file extension

Every config file has a similar structure:

# YAML syntax
name: Text # Displayed name of the config

attackAny: # Action categories
  - Condition 1 # List of the conditions where at least
  - Condition 2 # one of them must be met to cancel the action
  - ...
attackBlock:
  - Condition 1
  - Condition 2
  - ...
attackEntity:
  - ...
interactAny:
  - ...
interactBlock:
  - ...
interactEntity:
  - ...
useItem:
  - ...
placeBlock:
  - ...

The order of the categories doesn't matter.

If the name isn't specified, the filename will be used (my_file.yml → my_file).

Every category is optional in the config and represents an or operator: its content is a list of conditions where at least one of them must be met to cancel the action.

Different conditions may have different structures. For details, see the conditions list.

Action categories

Every action category describes what actions should be canceled, while its content describes in what circumstances.

Category Action
attackAny Player attacks anything, including air
attackBlock Player attacks or destroying a block
attackEntity Player attacks an entity
interactAny Player interacts with anything, including air
interactBlock Player interacts with a block
interactEntity Player interacts with an entity
useItem Player uses an item when it doesn't cause functional interactions with a block/entity.
E.g. opening a chest or placing a block won't reach this category, but eating an apple will do
placeBlock A special case of the interactBlock category for placing a block and using a bucket with a fluid. In addition to semantics, its feature is using coordinates of the expected placement position

Clone this wiki locally