#First time logging items
7 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
[➤](#1230535464201486477 message)
and use it like this
const starter_items = ["minecraft:torch", "minecraft:diamond"];
PlayerEvents.loggedIn(e => {
if(e.player.stages.has('start')) return;
e.player.stages.add('start');
e.player.inventory.clear();
starter_items.forEach(item => e.player.give(item));
//If you'd like to add starter armor like leather boots
//e.server.runCommandSilent(`item replace entity ${e.player.username} armor.feet with minecraft:leather_boots`);
});
use player stage, not a variable
Oh I thought stages came from an addon. Thank you !
or simply
PlayerEvents.loggedIn((event) => {
const { player } = event;
if (player.persistentData.getBoolean("first_join") === false) {
player.give(Item.of("minecraft:ender_pearl", 16));
player.persistentData.putBoolean("first_join", true);
}
})
Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.
Do you have any other questions regarding your issue? Feel free to ask!
Note: You should generally create a new post for unrelated issues.