InventoryKeeper

Introduction:
Do you feel that the vanilla drop is too difficult while keepInventory enabled is too simple and lose balance?
Then this plugin is very suitable for you.

How does it works?
This plugin provided specific items (virtual or physical item) or permission to restore players' inventory and exp. When player dies, the matched item with highest priority will be consumed to restore player's inventory.

Only works when gamerule keepInventory set to false.

 

Features:

  • Allow to set disabled worlds
  • Allow to set loss ratio of exp.
  • Allow to use random system.
  • Allow to clear cursed item.
  • Allow to run commands on death and respawn.
  • Command TAB auto-complete.
  • Custom skull texture support.
  • Custom model data support.
  • Custom death types support.
  • Virtual/Physical item & permission support.
  • PlaceholderAPI support.
  • Multiple items support.
  • Hex colors support. (Add hex code to messages directly. eg:#FFFFFF)
  • Make hunger level / saturation level customizable.
  • Freely filter entity type and custom name.
  • Fully customizable.
  • Simple to use.
  • 1.7-1.17 Support.

 

Commands & Permissions:

Admin commands:

/invkeep - Main command

/invkeep get <v/p> <item-name> [amount] - Get the specific item.

/invkeep give <v/p> <item-name> <player> [amount] - Give the item to a specific player.
(v -> Virtual item p->Physical item)

/invkeep take <player> <item-name> [amount ] - Take the virtual item from a player

/invkeep set <player> <item-name> [amount] - Set the amount of the virtual item of a player

/invkeep check [player] - Check the amount of virtual items

/invkeep reload - Reload config.

Permissioninventorykeeper.admin

Default OP has access to these commands.

 

  Player commands:

/invkeep check [player] - Allow players to check the amount of virtual item.


Permissions:

inventorykeeper.check - Allow to use /invkeep check (Default)
inventorykeeper.check.others - Allow to check the amount of other players.

inventorykeeper.unlimited.<Item Name> - Player with the permission can restore their inventory while the item (physical/virtual) will not be consumed, which means this player has unlimited quantity of the item. (Default:OP)

Note: Permission inventorykeeper.keep has been abandoned, use the new one instead.

 

 

Installation:

  1. Drag the jar file to your plugin folder and restart your server.
  2. Edit configuration files.
  3. Enjoy it.

 

 

Configuration:

 

config.yml

# *************************
#
# InventoryKeeper Config
#
# *************************
# Admin permission: inventorykeeper.admin The plugin only works when the world gamerule keepInventory is false.
# Configuration guide:
#
# Unlimited item permission: inventorykeeper.unlimited.<item name>
settings:
# Show debug messages if true. Trun it on if the plugin does not work properly and report it to author.
debug: false
# Display the death cause of a player in console. (Debug option) Default: false
show-death-cause-on-death: false
# If you are running on a modded server with Galacticraft mod installed, turn it on to keep galacticraft inventory. Default: false
galacticraft-mod-support: true
# Clear items with curse of vanishing when player dies.
clear-vanishing-curse-items: true
# Drop items with curse of binding when player dies.
drop-binding-curse-items: false
# Customize the default food level on respawn if a player died without keeping the inventory.
# Available types:
# keep -> Keep the food level on respawn instead of reset to full.
# reset -> Reset the food level on respawn like vanilla.
# set -> Customize the food level on respawn. Format: set,amount or set,min,max if you need a random food level.
# example: set,10 -> set the food level to 10 on respawn. set,5,10 -> set the food level to 5 - 10 on respawn.
default-hunger-level: set,10
# Customize the default saturation level on respawn if a player died without keeping the inventory.
default-saturation-level: set,0,5
# Compatibility Mode - if the plugin does not work properly, try to enable it.
# Don't enable this if the plugin works properly
compatibility-mode:
# try to set it to true if the item is consumed but the inventory still drops.
inventory: false
# try to set it to true if the experience level can not be set properly on respawn.
exp: false
# Execute commands on death if a player dies without keeping the inventory
# Command usage:%player% for the player name,%random% for a random number if needed
# To use random number in a command, the format should be: minimum|maximum|commands
# To run a command as OP, add [OP] on the head of a command.
# PlaceholderAPI placeholders are available now. To use placeholders, add them directly.
# To disable it, leave it empty. eg: run-commands-on-death-if-drops: []
# Example:
# run-commands-on-death-if-drops:
# - '[OP]fly off'
# - '10|200|eco take %player% %random%'
# - 'tell %player% Current server tps: %server_tps%'
run-commands-on-death-if-drops:
- '[OP]fly off'
# When player died without keeping the inventory, one of command groups will be chose randomly and executed.Same usage as above
# Mulitple commands is supported, use ";" to separate multiple commands, don't ADD ANY SPCAES after ";"
# Examples: (To disable, leave it empty: run-random-commands-on-death-if-drops: [])
run-random-commands-on-death-if-drops:
- 10|50|eco take %player% %random%;tell %player% You lost %random% coins!
- 1|10|eco give %player% %random%;tell %player% You gained %random% coins!
# Execute commands on respawn if a player dies without keeping the inventory.
# Examples:
# run-commands-on-respawn-if-drops:
# - '15|90|effect %player% minecraft:nausea %random% 1'
run-commands-on-respawn-if-drops:
- 15|90|effect %player% minecraft:nausea %random% 1
# When player died without keeping the inventory, one of command groups will be chose randomly and executed on respawn. Same usage as above.
# Examples:
# run-random-commands-on-respawn-if-drops:
# - 15|90|effect %player% minecraft:weakness %random% 1
# - 15|30|effect %player% minecraft:strength %random% 1
# - 15|30|effect %player% minecraft:resistance %random% 1
run-random-commands-on-respawn-if-drops:
- 15|90|effect %player% minecraft:weakness %random% 1
- 15|30|effect %player% minecraft:strength %random% 1
- 15|30|effect %player% minecraft:resistance %random% 1
messages:
lost-exp: '&eBut.. You lost &6%amount% &elevels exp.. Now your exp level is &a%total%&e.'
reloaded-config: '&aConfig reloaded!'
received-item: '&aYou just received &dx%amount% &e%item% &a!'
received-virtual-item: '&aYou just received &dx%amount% &e%item% &a,now you have
&e%total% &aitems!'
set-virtual-item: '&aSuccessfully set the amount of virtual item %item% for player
&e%player%&a, now the amount is &ex%amount%&a.'
take-virtual-item: '&aSuccessfully took &e%amount%x&a virtual items %item% from
&e%player%&a, now has &ex%total%&a!'
give-virtual-item: '&aSuccessfully gave &ex%amount%&a vitrual item %item% &r&ato
player &6%player%&a, now the total amount is &b%total% &a!'
modified-amount: '&eYour virtual &b%item% &ehas been modified, now you have &6x%amount%.'
virtual-item-count: '&eCurrently the virtual items you have :'
virtual-item-count-others: '&eCurrently player &6%p &ahas :'
virtual-item-format: '&7-&e %item% &7: &6%amount%'
no-permission: '&cYou dont have permission to use this command!'
player-only: '&cOnly player can use this command!'
is-not-number: '&e%s &cis not a valid number!'
item-not-exist: '&cThe item &d%s &cdoes not exist!'
give-usage: '&cUse &e/invkeep give <v/p> <item-name> <player> [amount]'
set-usage: '&cUse &e/invkeep set <player> <item-name> <amount>'
take-usage: '&cUse &e/invkeep take <player> <item-name> <amount>'
get-usage: '&cUse &e/invkeep get <v/p> <item-name> [amount]'
player-not-found: '&cPlayer &e%s &c is offline or not found!'
gave-item: '&aYou gave player &e%player% &6%amount%x &a%item%!'
invalid-item: '&cInvalid item name. Check your input or use item group name instead.'
help-msg:
- '&7----------&aInvKeeper Help&7----------'
- '&b /invkeep get <v/p> <item-name> [amount] &7- &6Get the specific item'
- '&b /invkeep give <v/p> <item-name> <player> [amount] &7- &6Give the saving item
to a player'
- '&b /invkeep take <player> <item-name> <amount> &7- &6Take the virtual item from
a player'
- '&b /invkeep set <player> <item-name> <amount> &7- &6Set the amount of a virtual
item of a player'
- '&b /invkeep check [player] &7- &6Check the remaining quantity of virtual items'
- '&b /invkeep reload &7- &6Reload config'
- ' &eV -> Virtual item'
- ' &eP -> Physical item'
- '&7------------------------------------'

 items.yml

# ********************
#
# Item Configuration
#
# ********************
# This configuration file is to set the custom items use to keep players' inventory.
# You can set multiple items. A higher priority item will be consumed first in players' inventory on death to keep their inventory.
# Here is an example of the custom item:
items:
#Group name, used to save player data. Once you set this, don't change it again.
default:
# In 1.13-, number and Sub-id(item damage) is accepted.
# Accepted examples: 273, '397:3', 'SKULL_ITEM:3', PLAYER_HEAD, 'WOOL:4'
item-id: 'STICK'
#The display name that will show in plugin commands. (Not the real item name)
name: '&6&lDeath amulet'
# TO use custom head texture, add it. (Optional)
# custom-texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWRmZjhkYmJhYjE1YmZiYjExZTIzYjFmNTBiMzRlZjU0OGFkOTgzMmMwYmQ3ZjVhMTM3OTFhZGFkMDA1N2UxYiJ9fX0=
# If you wish to use custom model, add custom-model-data. (Optional)
# custom-model-data: 1
# The display name of the item, remove this if you want to use vanilla item. (Optional)
item-name: '&6&lDeath amulet'
# The lore of the item. Remove it if not needed. (Optional)
item-lore:
- '&7Keeping this in your inventory,'
- '&7This amulet will restore your'
- '&7inventory if you died.'
# Set the enchantments of the item, Remove it if not needed. Format: ENCHANTMENT_NAME-LEVEL (Optional)
item-enchantments:
- durability-10
# Will the experience points be retained when the player dies.
save-exp: false
# The amount of exp the player will lose when he dies. If save-exp set to true, this will not work.
# Fixed value: exp-lose-percentage: 50 -> lose 50% exp
# Random value (minimum-maximum): exp-lose-percentage: 10-30 -> lose 10%-30% exp
exp-lose-percentage: 10-30
# Customize the food level on respawn.
# Available types:
# keep -> Keep the food level on respawn instead of reset to full.
# reset -> Reset the food level on respawn like vanilla.
# set -> Customize the food level on respawn. Format: set,amount or set,min,max if you need a random food level.
# example: set,10 -> set the food level to 10 on respawn. set,5,10 -> set the food level to 5 - 10 on respawn.
hunger-level: reset
# Customize the saturation level on respawn.
saturation-level: set,3,7
# The item will not work on the following worlds. Leave it empty or remove it to disable the function. (Optional)
disabled-worlds: []
# Execute commands on player death if this item is comsumed. The same as the settings in config.yml. (Optional)
# Leave it empty (Do not remove it) to disable the function.
run-commands-on-death: []
# One of command groups will be chose randomly and executed on player death. The same as the settings in config.yml. (Optional)
run-random-commands-on-death: []
# Execute commands on player respawn if this item is comsumed. The format is the same as above. (Optional)
run-commands-on-respawn:
- 15|90|effect %player% minecraft:fire_resistance %random% 1
# One of command groups will be chose randomly and executed on player respawn. (Optional)
run-random-commands-on-respawn:
- 10|30|effect %player% minecraft:strength %random% 1
- 10|30|effect %player% minecraft:speed %random% 1
filter-entities-list:
#if set to true (Blacklist mode), the inventory will NOT BE RESTORED if a player killed by the entity in the list.
#if set to false (Whitelist mode), the inventory will BE RESTORED if a player killed by the entity in the list.
is-blacklist: true
#To disable, leave the list empty. -> entities: []
#Entity name should be the namespace of minecraft.
# For example: MAGMA_CUBE, PLAYER, ENDER_DRAGON, ZOMBIE, ZOMBIE_VILLAGER, etc.
#You can find it out here: https://minecraft-ids.grahamedgecombe.com/entities
entities: []
filter-entities-name:
# if set to true (Blacklist mode), the inventory will NOT BE RESTORED if a player killed by a entity which name is in the list.
#if set to false (Whitelist mode), the inventory will BE RESTORED if a player killed by a entity which name is in the list.
is-blacklist: true
#To disable, leave the list empty. -> names-list: []
names-list: []
#Items with this lore will get removed on death.
#This works if you are using SoulBind plugin that will give the item repeatedly when a player respawns.
items-with-lore-to-be-removed-on-death:
- '&6Soul bind'
# The custom message sent when player dies.
death-message: '&aThe &eAncient amulet &ain your backpack &asaved your inventory!!'
#The highest one will be consumed first.
priority: 10
# Set the effective death type of the item.
#When the death type is set to true, this item will work if the player died from this death type
#If set it to false, the saving stick will not work.
#For a detailed explanation of death types, see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html
enabled-death-type:
CONTACT: true
LAVA: true
CRAMMING: true
ENTITY_SWEEP_ATTACK: true
FIRE_TICK: true
ENTITY_EXPLOSION: true
WITHER: true
FIRE: true
MAGIC: true
PROJECTILE: true
CUSTOM: true
FALL: true
SUICIDE: true
DRAGON_BREATH: true
DROWNING: true
LIGHTNING: true
FALLING_BLOCK: true
FLY_INTO_WALL: true
THORNS: true
ENTITY_ATTACK: true
BLOCK_EXPLOSION: true
HOT_FLOOR: true
STARVATION: true
VOID: true
PVP: true
SUFFOCATION: true

 

Tutorials:

   To use custom head:

To use custom head:

Add custom-texture below item-id

Example:

custom-texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjQyMmIwNTU5ZjkwZTZhOTk2ZjA0OTlkNDM0NGU5NTJkYzg4OTM0MGVkYmE1N2I4MzU5N2NlMTExMjk5MjQ3In19fQ==

  To set custom model data:

To set custom model data:

 Add custom-model-data below item-id.

Example:

settings:
  keep-inventory-item:
    item-id: player_head
    custom-model-data: 0
    item-name: '&a&lSaving Stick'

 

To run commands on death / respawn:

run-commands-on-death: []
run-commands-on-respawn: []

When player died (respawn), the commands in run-commands-on-death (run-commands-on-respawn) will be executed.

Example:

 run-commands-on-death:
   - 'eco take %player% 100'
    - '[OP]fly off'
    - '100|200|eco take %player% %random%'

 To run random commands:

run-random-commands-on-death: []
run-random-commands-on-respawn: []

(Support multiple commands, using ";" to separate multiple commands, dont ADD ANY SPCAES after ";"!!)

Example:

run-random-commands-on-death:
 - 'tell %player% Oops! You died!;eco take %player% 100'
  - '[OP]fly off'
  - '100|200|eco take %player% %random%;tell %player% Oops! You have lost %random% coins!'

 It will randomly choose one of the groups and execute the commands in the group.

Placeholders:
%player% -> The player name
%random% -> Replaces random number.

To run a command as OP, add "[OP]" in the head of a command.

To use random number, the command format should be:
minimum|maximum|command 1;command 2...

 

 

 

PlaceholderAPI Support
Placeholders:
%inventorykeeper_amount_<Item name>% - Returns the amount of virtual item of a player.
%inventorykeeper_amount_<Item name>,<player name>% - Returns the virtual item amount of other players. (Only for online players.)

PAPI placeholders now can be add to death / respawn commands directly.

 

Screenshots:

An example that gives negative buff and keep hunger level on respawn

 

consume an item with highest priority to restore inventory.

 

 

 

 

 

Bugs:

For issues and suggestions, create a comment here!

 

Donation:

Welcome to donate us if you think this plugin is good to use!

Donate link:Click here

 

Links: bStats

Plugin Statistics

statistics


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit