Class BlockEvent.EntityPlaceEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.BlockEvent.EntityPlaceEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Direct Known Subclasses:
BlockEvent.EntityMultiPlaceEvent
Enclosing class:
BlockEvent

public static class BlockEvent.EntityPlaceEvent extends BlockEvent implements net.neoforged.bus.api.ICancellableEvent
Called when a block is placed. If a Block Place event is cancelled, the block will not be placed.
  • Field Details

    • entity

      private final net.minecraft.world.entity.Entity entity
    • blockSnapshot

      private final BlockSnapshot blockSnapshot
    • placedBlock

      private final net.minecraft.world.level.block.state.BlockState placedBlock
    • placedAgainst

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

    • EntityPlaceEvent

      public EntityPlaceEvent(BlockSnapshot blockSnapshot, net.minecraft.world.level.block.state.BlockState placedAgainst, @Nullable @Nullable net.minecraft.world.entity.Entity entity)
  • Method Details

    • getEntity

      @Nullable public @Nullable net.minecraft.world.entity.Entity getEntity()
    • getBlockSnapshot

      public BlockSnapshot getBlockSnapshot()
    • getPlacedBlock

      public net.minecraft.world.level.block.state.BlockState getPlacedBlock()
    • getPlacedAgainst

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