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.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockSnapshot
private final net.minecraft.world.entity.Entity
private final net.minecraft.world.level.block.state.BlockState
private final net.minecraft.world.level.block.state.BlockState
-
Constructor Summary
ConstructorsConstructorDescriptionEntityPlaceEvent
(BlockSnapshot blockSnapshot, net.minecraft.world.level.block.state.BlockState placedAgainst, @Nullable net.minecraft.world.entity.Entity entity) -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.entity.Entity
net.minecraft.world.level.block.state.BlockState
net.minecraft.world.level.block.state.BlockState
Methods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getLevel, getPos, getState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
entity
private final net.minecraft.world.entity.Entity entity -
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
-
getPlacedBlock
public net.minecraft.world.level.block.state.BlockState getPlacedBlock() -
getPlacedAgainst
public net.minecraft.world.level.block.state.BlockState getPlacedAgainst()
-