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.Block
getBlock()
net.minecraft.block.BlockState
net.minecraft.item.ItemPlacementContext
net.minecraft.server.network.ServerPlayerEntity
net.minecraft.server.world.ServerWorld
getWorld()
boolean
void
setCancelled
(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:
isCancelled
in interfaceEvent
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceEvent
-