Interface BlockEntityModifier

All Superinterfaces:
Wrapper
All Known Subinterfaces:
AppendLootModifier, AppendStaticModifier, ClearModifier, PassthroughModifier

@NullMarked @AsOf("3.4.0") public interface BlockEntityModifier extends Wrapper
Wraps Minecraft's RuleBlockEntityModifier: what a processor rule does to the block entity data of the block it replaces, such as filling a suspicious sand block with loot.
Since:
3.4.0
See Also:
  • Method Details

    • clear

      @AsOf("3.4.0") static ClearModifier clear()
      Removes the block entity data.
      Returns:
      the clearing modifier
      Since:
      3.4.0
    • passthrough

      @AsOf("3.4.0") static PassthroughModifier passthrough()
      Keeps the block entity data as it is. A rule without a modifier uses this.
      Returns:
      the pass-through modifier
      Since:
      3.4.0
    • appendStatic

      @AsOf("3.4.0") static AppendStaticModifier appendStatic(String snbt)
      Merges fixed data into the block entity.
      Parameters:
      snbt - the data, as SNBT, for example {CustomName:'"Tomb"'}
      Returns:
      an append-static modifier
      Since:
      3.4.0
    • appendLoot

      @AsOf("3.4.0") static AppendLootModifier appendLoot(ResourceKey lootTable)
      Gives the block entity a loot table, as trail ruins do for suspicious gravel.
      Parameters:
      lootTable - the key of the loot table
      Returns:
      an append-loot modifier
      Since:
      3.4.0
    • decode

      @AsOf("3.4.0") static BlockEntityModifier decode(Object minecraftModifier)
      Reads a Minecraft block entity modifier.
      Parameters:
      minecraftModifier - the modifier to read
      Returns:
      the decoded modifier
      Since:
      3.4.0