Class BlockStateModifyPlacementCallback

java.lang.Object
dev.latvian.mods.kubejs.block.callback.BlockStateModifyCallback
dev.latvian.mods.kubejs.block.callback.BlockStateModifyPlacementCallback

public class BlockStateModifyPlacementCallback extends BlockStateModifyCallback
  • Field Details

    • context

      public final net.minecraft.world.item.context.BlockPlaceContext context
    • minecraftBlock

      public final net.minecraft.world.level.block.Block minecraftBlock
    • block

      public LevelBlock block
  • Constructor Details

    • BlockStateModifyPlacementCallback

      public BlockStateModifyPlacementCallback(net.minecraft.world.item.context.BlockPlaceContext context, net.minecraft.world.level.block.Block block)
  • Method Details

    • getClickedPos

      @Info("Gets the clicked position in world") public net.minecraft.core.BlockPos getClickedPos()
    • getClickedBlock

      @Info("Gets the clicked block") public LevelBlock getClickedBlock()
    • canPlace

      @Info("Returns if the block being placed thinks it can be placed here. This is used for replacement checks, like placing blocks in water or tall grass") public boolean canPlace()
    • replacingClickedOnBlock

      @Info("Returns if the block being placed is replacing the block clicked") public boolean replacingClickedOnBlock()
    • getNearestLookingDirection

      @Info("Gets the direction closes to where the player is currently looking") public net.minecraft.core.Direction getNearestLookingDirection()
    • getNearestLookingVerticalDirection

      @Info("Gets the vertical direction (UP/DOWN) closest to where the player is currently looking") public net.minecraft.core.Direction getNearestLookingVerticalDirection()
    • getNearestLookingDirections

      @Info("Gets an array of all directions, ordered by which the player is looking closest to") public net.minecraft.core.Direction[] getNearestLookingDirections()
    • getClickedFace

      @Info("Gets the facing direction of the clicked block face") public net.minecraft.core.Direction getClickedFace()
    • getClickLocation

      @Info("Gets the position in the block-space of where it was clicked") public net.minecraft.world.phys.Vec3 getClickLocation()
    • isInside

      @Info("Returns if the hit posiiton in the block-space is inside the 1x1x1 cube of the block") public boolean isInside()
    • getItem

      @Info("Gets the item being placed") public net.minecraft.world.item.ItemStack getItem()
    • getPlayer

      @Nullable @Info("Gets the player placing the block, if available") public @Nullable net.minecraft.world.entity.player.Player getPlayer()
    • getHand

      @Info("Gets the hand that is placing the block") public net.minecraft.world.InteractionHand getHand()
    • getLevel

      @Info("Gets the level") public net.minecraft.world.level.Level getLevel()
    • getHorizontalDirection

      @Info("Gets the nearest horizontal direction to where the player is looking. NORTH if there is no player") public net.minecraft.core.Direction getHorizontalDirection()
    • isSecondaryUseActive

      @Info("Returns if the player is using the \'secondary\' function of this item. Basically checks if they are holding shift") public boolean isSecondaryUseActive()
    • getRotation

      @Info("Get the horizontal rotation of the player") public float getRotation()
    • getFluidStateAtClickedPos

      @Info("Gets the FluidSate at the clicked position") public net.minecraft.world.level.material.FluidState getFluidStateAtClickedPos()
    • isClickedPosIn

      @Info("Checks if the position clicked has a specified fluid there") public boolean isClickedPosIn(net.minecraft.world.level.material.Fluid fluid)
    • waterlogged

      @Info("Set if this block is waterlogged or not") public BlockStateModifyPlacementCallback waterlogged(boolean waterlogged)
    • waterlogged

      @Info("Set this block as waterlogged if it is in water") public BlockStateModifyPlacementCallback waterlogged()
    • isInWater

      @Info("Checks if this block is in water") public boolean isInWater()
    • isReplacingSelf

      @Info("Checks if the block currently occupying the position this is being placed in is the same block type.\nUsed for things like candles, where multiple can be in the same block-space.\n") public boolean isReplacingSelf()