Reinitailized repository
This commit is contained in:
commit
b4fb99fc02
2864 changed files with 697863 additions and 0 deletions
23
kubejs/server_scripts/keep.js
Normal file
23
kubejs/server_scripts/keep.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Makes Tickets of Eternal Keeping not consumed on death.
|
||||
|
||||
const tickets = {};
|
||||
|
||||
EntityEvents.death((event) => {
|
||||
const player = event.player;
|
||||
if (event.entity.isPlayer()) {
|
||||
tickets[player.uuid] = null;
|
||||
|
||||
player.inventory.allItems.forEach((item) => {
|
||||
if (item.nbt && item.nbt.EternalKeep) tickets[player.uuid] = item.copy();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
PlayerEvents.respawned((event) => {
|
||||
const player = event.player;
|
||||
|
||||
const ticket = tickets[player.uuid];
|
||||
if (ticket != null) player.give(Item.of(ticket, 1));
|
||||
|
||||
tickets[player.uuid] = null;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue