use of net.minecraftforge.event.world.BlockEvent.EntityPlaceEvent in project MinecraftForge by MinecraftForge.
the class ForgeEventFactory method onBlockPlace.
public static boolean onBlockPlace(@Nullable Entity entity, @Nonnull BlockSnapshot blockSnapshot, @Nonnull Direction direction) {
BlockState placedAgainst = blockSnapshot.getLevel().getBlockState(blockSnapshot.getPos().relative(direction.getOpposite()));
EntityPlaceEvent event = new BlockEvent.EntityPlaceEvent(blockSnapshot, placedAgainst, entity);
return MinecraftForge.EVENT_BUS.post(event);
}
Aggregations