replace_near

Replaces blocks of one type with another within a specified radius around the trigger location.

Categories: world

Required arguments

Key(s)DescriptionType
radiusThe horizontal radius to search for blocks. Supports expressions.EXPRESSION
radius_yThe vertical radius to search for blocks. Supports expressions.EXPRESSION
replace_toThe block type to replace matching blocks with.BLOCK

Optional arguments

Key(s)DescriptionTypeDefault
whitelistA list of block types that are allowed to be replaced. If omitted, all non-air blocks are eligible.BLOCK_LIST
blacklistA list of block types that should never be replaced.BLOCK_LIST
durationHow long (in ticks) before the replaced blocks revert to their original type. Supports expressions.EXPRESSION
disable_on_sneakWhether to skip replacement when the player is sneaking.BOOLEANfalse
exposed_onlyWhether to only replace blocks that have air directly above them.BOOLEANfalse
source_onlyWhether to only replace source liquid blocks (level 0).BOOLEANfalse

Trigger parameters required

  • PLAYER

Example

effects:
  - id: replace_near
    args:
      radius: 3 + %level% * 0.3
      radius_y: 2 + %level% * 0.2
      replace_to: <value>
      whitelist: <value> # ← Optional
      blacklist: <value> # ← Optional
      duration: 20 * %level% # ← Optional
      disable_on_sneak: true # ← Optional
      exposed_only: true # ← Optional
      source_only: true # ← Optional

Behaviour

SettingValue
Run orderNORMAL
Supports delaytrue
Reloads on plugin reloadtrue