Class BlockEvent.FluidPlaceBlockEvent

  • Enclosing class:
    BlockEvent

    public static class BlockEvent.FluidPlaceBlockEvent
    extends BlockEvent
    Fired when a liquid places a block. Use #setNewState(IBlockState) 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.
    • Method Detail

      • 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.