#Function for triggering the bonemeal effect

1 messages · Page 1 of 1 (latest)

lucid nebula
#

what is the function behind the bonemeal?

buoyant frost
#

are you asking for a function that recreates the effect of bonemealing something?

wet dragon
#

When you interact with a block using a bonemeal, change the state of block. That's how it work.

wet dragon
#

Yes, actually script is the only way to do that.

lucid nebula
languid saddle
mint meadow
lucid nebula
#

or area

#

I only found getBlock

#

or

lucid nebula
#

how would you get a location in a area?

#

like how you use /fill

lucid nebula
#
 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

lucid nebula
#
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