Beta
Readonly
Beta
dimensionReturns the dimension that the block is within.
Beta
isReturns or sets whether this block has a liquid on it.
Readonly
Beta
locationCoordinates of the specified block.
Readonly
Beta
permutationAdditional block configuration data that describes the block.
Readonly
Beta
typeGets the type of block.
Readonly
Beta
typeIdentifier of the type of block for this block.
Readonly
Beta
xX coordinate of the block.
Readonly
Beta
yY coordinate of the block.
Readonly
Beta
zZ coordinate of the block.
Beta
Block type or block permutation to check placement for.
Optional
faceToPlaceOn: DirectionOptional specific face of this block to check placement against.
Returns true
if the block type or permutation can be
placed on this block, else false
.
Beta
Identifier of the component. If a namespace is not specified, minecraft: is assumed.
Returns the component object if it is present on the particular block.
Beta
Tag to check for.
Returns true
if the permutation of this block has the tag,
else false
.
import { world } from "@minecraft/server";
// Fetch the block
const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
console.log(`Block is dirt: ${block.hasTag("dirt")}`);
console.log(`Block is wood: ${block.hasTag("wood")}`);
console.log(`Block is stone: ${block.hasTag("stone")}`);
Beta
Beta
Beta
Beta
Permutation that contains a set of property states for the Block.
Beta
Identifier of the type of block to apply - for example, minecraft:powered_repeater.
Beta
Permutation that contains a set of property states for the Block.
Returns true
if the block permutation data was
successfully set, else false
.
Represents a block in a dimension. A block represents a unique X, Y, and Z within a dimension and get/sets the state of the block at that location. This type was significantly updated in version 1.17.10.21.