Skip to content

Commit

Permalink
Fix keep inventory behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ferriarnus committed Jul 19, 2023
1 parent 1b6e17a commit 2916322
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public static void deathHandler(LivingDropsEvent event) {
public static void reviveHandler(PlayerEvent.Clone event) {
if (!event.getOriginal().isDeadOrDying()) {
return;
}//TODO More detailed and better item recovery.
}
if (event.getEntity().level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY)) {
return;
}
//TODO More detailed and better item recovery.
event.getOriginal().getInventory().items.forEach(item -> event.getEntity().addItem(item));
event.getOriginal().getInventory().armor.forEach(armor -> event.getEntity().addItem(armor));
event.getOriginal().getInventory().offhand.forEach(offhand -> event.getEntity().addItem(offhand));
Expand Down

0 comments on commit 2916322

Please sign in to comment.