#Event for armor equip

29 messages · Page 1 of 1 (latest)

sullen lake
#

Can someone tell me the onEvent event that triggers each time armor piece is equipped(doesn't matter if it was right-clicked in the hotbar or equipped with the mouse or by dispenser)

shell orchidBOT
#

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

dusk cave
#

should be the inventory changed event

sullen lake
#

player.inventory.changed ?

dusk cave
#

i think theres a _ there

soft walrusBOT
#

This is a list of all the events. Choose your version.

dusk cave
#

oh there isnt

#

then yes :d

sullen lake
#

yes, I got it from here

#

Probe is powerful hooolllyyy

dusk cave
#

never used it SIPPING

wet copper
#

sec

#

oh nvm

dusk cave
wet copper
#

i was gonna suggest the forge armor change event but this probably works fine

wet copper
sullen lake
#

It's not for this ticket, but any ideas how I can send message to player?

dusk cave
#

e.player.tell()

sullen lake
#
onEvent('player.inventory.changed', event => {
    var iSlot = event.getSlot();
    var sItemId = event.getItem().getId();
    if(iSlot == 8 && sItemId === 'ssrp:farmer_boots') {
        //send message only to player
    }
    console.log("Slot: " + event.getSlot());
    console.log("Item: " + event.getItem().getId());
});
#

Can I use some color coding?

#

with &a for green or?

dusk cave
#

you can use Text class

#

for instance

#

e.player.tell(Text.green('hello'))

#

i think theres a page on it

soft walrusBOT
#

You can use Text Components a lot in KubeJS, and the wiki has a page on them!

dusk cave
#

there