Class BlockEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
Direct Known Subclasses:
BlockDropsEvent, BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent, CreateFluidSourceEvent, CropGrowEvent, NoteBlockEvent, PistonEvent

public abstract class BlockEvent extends net.neoforged.bus.api.Event
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Fired when a block is right-clicked by a tool to change its state.
    static class 
    This event is fired on the server when a player attempts to break a block, upon receipt of a block break packet.
    static class 
    Fired when a single block placement triggers the creation of multiple blocks(e.g. placing a bed block).
    static class 
    Called when a block is placed.
    static class 
    Fired when when farmland gets trampled This event is ICancellableEvent
    static class 
    Fired when a liquid places a block.
    static class 
    Fired when a physics update occurs on a block.
    static class 
    Fired when an attempt is made to spawn a nether portal from BaseFireBlock.onPlace(BlockState, Level, BlockPos, BlockState, boolean).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final boolean
     
    private final net.minecraft.world.level.LevelAccessor
     
    private final net.minecraft.core.BlockPos
     
    private final net.minecraft.world.level.block.state.BlockState
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockEvent(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.LevelAccessor
     
    net.minecraft.core.BlockPos
     
    net.minecraft.world.level.block.state.BlockState
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEBUG

      private static final boolean DEBUG
    • level

      private final net.minecraft.world.level.LevelAccessor level
    • pos

      private final net.minecraft.core.BlockPos pos
    • state

      private final net.minecraft.world.level.block.state.BlockState state
  • Constructor Details

    • BlockEvent

      public BlockEvent(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getLevel

      public net.minecraft.world.level.LevelAccessor getLevel()
    • getPos

      public net.minecraft.core.BlockPos getPos()
    • getState

      public net.minecraft.world.level.block.state.BlockState getState()