#Block oxidizing into different blocks based on dimension

2 messages · Page 1 of 1 (latest)

frank wind
#

I want this block to oxidize like copper but it becomes a different oxidized block depending on the dimension

ie in the overworld it becomes kubejs:blue_oxidized_bismuth and in the nether it becomes kubejs:red_oxidized_bismuth

The randomtick code is based on an example script posted in this server

    event.create('bismuth_crystal')
    .displayName('Bismuth Crystal')
    .soundType('metal')
    .hardness(3.0)
    .resistance(6.0)
    .requiresTool(true)
    .tagBlock('minecraft:mineable/pickaxe')
    .tagBlock('minecraft:needs_stone_tool')
    .randomTick((e) => {
        const block = e.block;
        const level = e.level;

        if (Math.random() > 64 / 225) {
          return; 
        }

        
        let a = 0;
        let b = 0;
        
        const c = (b + 1) / (a + 1);
        const m = block.id == "kubejs:bismuth_crystal" ? 0.75 : 1;

        if (Math.random() > m * c * c) {
          return;
        }

        level.setBlockAndUpdate(
          block.pos,
          Block.id("kubejs:blue_oxidized_bismuth").getBlockState()
        );
    });
green vectorBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!