Class BlockStateModifyPlacementCallback
java.lang.Object
dev.latvian.mods.kubejs.block.callback.BlockStateModifyCallback
dev.latvian.mods.kubejs.block.callback.BlockStateModifyPlacementCallback
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal net.minecraft.world.item.context.BlockPlaceContextfinal net.minecraft.world.level.block.Block -
Constructor Summary
ConstructorsConstructorDescriptionBlockStateModifyPlacementCallback(net.minecraft.world.item.context.BlockPlaceContext context, net.minecraft.world.level.block.Block block) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlace()net.minecraft.core.Directionnet.minecraft.core.BlockPosnet.minecraft.world.phys.Vec3net.minecraft.world.level.material.FluidStatenet.minecraft.world.InteractionHandgetHand()net.minecraft.core.Directionnet.minecraft.world.item.ItemStackgetItem()net.minecraft.world.level.LevelgetLevel()net.minecraft.core.Directionnet.minecraft.core.Direction[]net.minecraft.core.Direction@Nullable net.minecraft.world.entity.player.PlayerfloatbooleanisClickedPosIn(net.minecraft.world.level.material.Fluid fluid) booleanisInside()booleanbooleanbooleanbooleanwaterlogged(boolean waterlogged) Methods inherited from class dev.latvian.mods.kubejs.block.callback.BlockStateModifyCallback
cycle, get, getOptionalValue, getProperties, getState, getValue, getValues, hasProperty, mirror, populateNeighbours, rotate, set, set, set, setValue, toString, updateShape
-
Field Details
-
context
public final net.minecraft.world.item.context.BlockPlaceContext context -
minecraftBlock
public final net.minecraft.world.level.block.Block minecraftBlock -
block
-
-
Constructor Details
-
BlockStateModifyPlacementCallback
public BlockStateModifyPlacementCallback(net.minecraft.world.item.context.BlockPlaceContext context, net.minecraft.world.level.block.Block block)
-
-
Method Details
-
getClickedPos
-
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
-
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
-
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
-
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
-
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()
-