Not lose X item in death

Discussion in 'Plugin Development' started by PotenciaMax, Jun 1, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    PotenciaMax

    How i make a plugin for when a player death we dont lose a X item whit X name and X lore? for example a jetsminions plugin minion.
     
  2. Offline

    Legendary_zotar

    @PotenciaMax If your looking for someone to make the plugin for you, you can post in plugin requests if your wondering how you can make it yourself, You can create a custom config that adds that item to it, then when a player dies, check if he has that item, if he does, remove it from the Drops and when he respawns add it to his Inventory using maybe a Hashmap to save the items to add.
     
  3. Offline

    mAndAle

    If your not asking for plugin an option is to use a loop

    for example :

    Code:
    for (ItemStack i : p.getInventory().getContents(){
    if (i.hasItemMeta() && i.getItemMeta.hasLore()){
    if (i.getItemMeta().getLore().contains("your lore"){
    //do your thing
    }
    }
    }
     
Thread Status:
Not open for further replies.

Share This Page