Class PlayerBlockPlaceEvent
java.lang.Object
net.vitacraft.serverlibraries.api.event.events.blocks.PlayerBlockPlaceEvent
- All Implemented Interfaces:
Event
Called when a player places a block
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerBlockPlaceEvent(net.minecraft.item.ItemPlacementContext context, net.minecraft.block.BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.block.BlockgetBlock()net.minecraft.block.BlockStatenet.minecraft.item.ItemPlacementContextnet.minecraft.server.network.ServerPlayerEntitynet.minecraft.server.world.ServerWorldgetWorld()booleanvoidsetCancelled(boolean cancelled)
-
Constructor Details
-
PlayerBlockPlaceEvent
public PlayerBlockPlaceEvent(net.minecraft.item.ItemPlacementContext context, net.minecraft.block.BlockState blockState)
-
-
Method Details
-
getPlayer
public net.minecraft.server.network.ServerPlayerEntity getPlayer()- Returns:
- the player who placed the block
-
getBlock
public net.minecraft.block.Block getBlock()- Returns:
- the block that was placed
-
getBlockState
public net.minecraft.block.BlockState getBlockState()- Returns:
- the block state of the block that was placed
-
getWorld
public net.minecraft.server.world.ServerWorld getWorld()- Returns:
- the world where the block was placed
-
getContext
public net.minecraft.item.ItemPlacementContext getContext()- Returns:
- the context of the block placement
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceEvent
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceEvent
-