#Script error

5 messages · Page 1 of 1 (latest)

high whale
#

I'm trying to do this thing :

When i right click with a cactus renamed "ciao" it spawn a stone block under me

ItemEvents.rightClicked(event => {
const player = event.entity;
const item = event.item;

if (item.id === 'minecraft:cactus' && item.hoverName === 'ciao') {
player.block.down.set('minecraft:stone');
player.displayClientMessage('Il blocco sotto di te è stato cambiato in pietra!', true);
return 1;
};
}
);

it don't work

trail obsidianBOT
#

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

high whale
#

I also tried

ItemEvents.rightClicked(event => {
const player = event.entity;
const item = event.item;

if (item.id === 'minecraft:cactus') {
if (item.hoverName === 'ciao') {
player.block.down.set('minecraft:stone');
player.displayClientMessage('Il blocco sotto di te è stato cambiato in pietra!', true);
return 1;
};
}
});

#

without the name thing it works

#

Resolved