Class BlockEvent.FluidPlaceBlockEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.BlockEvent
net.minecraftforge.event.level.BlockEvent.FluidPlaceBlockEvent
Enclosing class:
BlockEvent

public static class BlockEvent.FluidPlaceBlockEvent extends BlockEvent
Fired when a liquid places a block. Use setNewState(BlockState) to change the result of a cobblestone generator or add variants of obsidian. Alternatively, you could execute arbitrary code when lava sets blocks on fire, even preventing it. BlockEvent.getState() will return the block that was originally going to be placed. BlockEvent.getPos() will return the position of the block to be changed.
  • Field Details

  • Constructor Details

  • Method Details

    • getLiquidPos

      public BlockPos getLiquidPos()
      Returns:
      The position of the liquid this event originated from. This may be the same as BlockEvent.getPos().
    • getNewState

      public BlockState getNewState()
      Returns:
      The block state that will be placed after this event resolves.
    • setNewState

      public void setNewState(BlockState state)
    • getOriginalState

      public BlockState getOriginalState()
      Returns:
      The state of the block to be changed before the event was fired.