#Function for triggering the bonemeal effect
1 messages · Page 1 of 1 (latest)
are you asking for a function that recreates the effect of bonemealing something?
When you interact with a block using a bonemeal, change the state of block. That's how it work.
is that possible in script?
Yes, actually script is the only way to do that.
it's blockPermutation? I went through the API
If the states of the block you're trying to change is numbers it would be easy but if it's string you need to list it
U need to change blocks and add particles i guess
how do you get blocks ina radius?
or area
I only found getBlock
or
that question is broad
how would you get a location in a area?
like how you use /fill
const cubeDim = 7;
*
* function placeRainbowCube(location: DimensionLocation) {
* let colorIndex = 0;
* for (let x = 0; x <= cubeDim; x++) {
* for (let y = 0; y <= cubeDim; y++) {
* for (let z = 0; z <= cubeDim; z++) {
* colorIndex++;
* location.dimension
* .getBlock({ x: location.x + x, y: location.y + y, z: location.z + z })
* ?.setPermutation(BlockPermutation.resolve(allWoolBlocks[colorIndex % allWoolBlocks.length]));
* }
* }
* }
* }
found this
system.runInterval(() =>{
let players = world.getAllPlayers()
players.forEach(player=>{
let location = player.location;
location.y -= 1;
const transformPerm = BlockPermutation.resolve(mc.MinecraftBlockTypes.WhiteWool);
player.dimension.getBlock(location)?.setPermutation(transformPerm);
})
},1)
can't get the miencraftblocktypes right