#placement filter when using set block or similar methods
1 messages · Page 1 of 1 (latest)
To get a placement filter you would need to use the block volume and the fill blocks method there isn't one for the set block at least not to my knowledge fill blocks can be accessed by either doing player. Dimension or world dot dimension
be easier to just check the block tags same as in the block JSON at that point though wouldn't it?
There is the canPlace method, but its currently in beta. I haven't used it myself yet though.
-# (I could use this to make an offhand addon probably)
/**
* @beta
* @remarks
* Checks to see whether it is valid to place the specified
* block type or block permutation, on a specified face on this
* block.
*
* @param blockToPlace
* Block type or block permutation to check placement for.
* @param faceToPlaceOn
* Optional specific face of this block to check placement
* against.
* @returns
* Returns `true` if the block type or permutation can be
* placed on this block, else `false`.
* @throws This function can throw errors.
*
* {@link Error}
*
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
*/
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
That's a method on the Block class.