Class PlayerBlockPlaceEvent

java.lang.Object
net.vitacraft.serverlibraries.api.event.events.blocks.PlayerBlockPlaceEvent
All Implemented Interfaces:
Event

public class PlayerBlockPlaceEvent extends Object implements Event
Called when a player places a block
  • 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 interface Event
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface Event