#How to make this in 1.20.60

1 messages · Page 1 of 1 (latest)

celest halo
#
World.events.beforeItemUseOn.subscribe(eventData => {
    const { source, blockLocation } = eventData
    const { x, y, z } = blockLocation
    const cataclysm = new BlockLocation(x, y, z)
    try {
        if (source.hasTag('is_using_cataclysm')) {
            source.runCommand(`setblock ${cataclysm.x} ${cataclysm.y} ${cataclysm.z} miraculous:cataclysm_block`)
        }
    } catch { }
})

and

        setTickTimeout(() => {
            if (player.hasTag('is_using_cataclysm')) {
                player.removeTag('is_using_cataclysm')
                player.addTag('already_use_cataclysm')
                player.runCommand("titleraw @s actionbar {\"rawtext\":[{\"translate\":\"speak.miraculous:power_finished\"}]}")
            }
        }, 300)
    } catch { }

and how to add lore to item

celest halo
#

Anyone to help Me?

rich mist
#
world.beforeEvents.itemUseOn.subscribe((data) => {
    const { source, block, itemStack } = data;
    if (itemStack.typeId !== 'miraculous:cataclysm' /*Idk what your item is*/) return; 
    data.cancel = true;

    block.setType('miraculous:cataclysm_block');
});
celest halo
#

Ohh

#

Thanks

rich mist
#

Actually let me change something

celest halo
#

Ok

rich mist
#

Now its better

celest halo
#

You know how to make lore I tried looking in Microsoft documents but I couldn't find it

rich mist
celest halo
#

I tried

rich mist
#

How are you giving the players your item?

celest halo
#

Inventory

rich mist
#

I mean, scripts or commands?

celest halo
#

Scripts

rich mist
#
const inv = player.getComponent('inventory').container;
const item = new ItemStack('minecraft:stick');
item.setLore(['Line 1', 'Line 2'])
inv.addItem(item)
celest halo
#

Thanks

#

How i can make a script wait a time to run other script?