Skip to content

Instantly share code, notes, and snippets.

@aikar aikar/
Created Mar 28, 2019

What would you like to do?
Example of using PlayerDeathEvent#getItemsToKeep
@EventHandler(ignoreCancelled = true)
public void onPlayerDeath(PlayerDeathEvent event) {
for (Iterator<ItemStack> iterator = event.getDrops().iterator(); iterator.hasNext(); ) {
ItemStack drop =;
List<String> lore = drop.getLore();
if (lore != null && !lore.isEmpty()) {
if (lore.get(0).contains("(SOULBOUND)")) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.