#equip an armor on first join

60 messages · Page 1 of 1 (latest)

abstract atlas
#

I'd like to equip an armor so I have got js PlayerEvents.loggedIn(event => { if (!event.player.persistentData.contains('firstjoin')) { event.player.persistentData.putBoolean('firstjoin', true) } }), but then how do I give the armor in a spesific slot ?

elder ginkgoBOT
#

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

torpid mulch
abstract atlas
#

aah thanks

#

i though I had done that before... I couldn't remind/find it

abstract atlas
torpid mulch
#

try searching the discord, its been done and asked many times before
im working so i cant help with it too much

abstract atlas
scarlet gale
#

You could try this: event.player.setHeadArmorItem()

#

with the other slots too

abstract atlas
#

I've done some testing, and neather this : js PlayerEvent.loggedIn(event => { if (!event.player.persistentData.contains('hasJoinedBefore')) { event.player.persistentData.putBoolean('hasJoinedBefore', false) event.player.give('128x kubejs:sigma') } })
neather this :

PlayerEvent.loggedIn(event => {
    if (!event.player.persistentData.contains('firstjoin')) {
        event.player.persistentData.putBoolean('firstjoin', true)
        event.player.give('128x kubejs:sigma')
    }
})```
#

works

abstract atlas
torpid mulch
#

did you create a new world, or remove the persistent data for this to work?

abstract atlas
#

wait, is this a sever event ?

torpid mulch
#

yes? confused_dog_lex

#

what else would it be Pika

abstract atlas
#

well that's what I did

abstract atlas
#

stil that's very weird... whyè doesn't it work

#

would that be possible that this option would be disactivated by one of the mods that gives a book ?

abstract atlas
#

okay ; I've done some more testing, and it appears to be, the PlayerEvent.loggedIn(event => { that doesn't work

#

imma try this on a server

abstract atlas
#

MYSELF : BE CURSED

#

I forgot the "s"

torpid mulch
abstract atlas
#

i'm testing, then if it works i'll close the thread

pliant lily
abstract atlas
#

(its me, deathtroyer lol)

#

OKAY ; I've got my 128 "Σ"

abstract atlas
torpid mulch
#

polar bears

#

oh its the cats server that changed to polar bears for april fools lmao

pliant lily
#

lmao

pliant lily
#

my server list is a mess rn

#

got prison launcher

abstract atlas
#

everyone renamed themself fish

#

it's awfull

pliant lily
abstract atlas
#

what is pecial in there ?

abstract atlas
#

htanks you everyone, it works perfect now

elder ginkgoBOT
#

Ticket closed!

abstract atlas
#

also if someone needs, there is the final code

PlayerEvents.loggedIn(event => {
    if (!event.player.stages.has('starting_items')) {
            event.player.stages.add('starting_items')
            event.player.give('128x kubejs:sigma')
            event.player.setHeadArmorItem('funkube_ressources:civilian_helmet')
            event.player.setChestArmorItem('funkube_ressources:civilian_chestplate')
            event.player.setLegsArmorItem('funkube_ressources:civilian_leggings')
            event.player.setFeetArmorItem('funkube_ressources:civilian_boots')

    }
})``` (ofc replace the item names)
pliant lily
#

uh close the ticket again

#

you reopenened it

#

also you can use beans

#

so liek event.player.legsArmorItem = 'item'