Skip to content

[item loss] new death chest overwrites old oneΒ #96

@JoMaZu787

Description

@JoMaZu787

Describe the bug
When you /tp to the coords given in the death chest message and then die at that position with new items in your inventory before removing the old chest by taking out all the items, the new death chest overwrites the first one, destroying all the items

To Reproduce
Minecraft Server Implementation: Paper

Steps to reproduce the behavior:

  1. get 2 different items
  2. die
  3. /tp to the coords in the chat message
  4. don't move!
  5. get one of the items from the chest
  6. die again
  7. repeat the /tp command
  8. the chest will have only the item you took out
  9. take out the item again
  10. you are left with an empty vanilla chest

Expected behavior
my items don't disappear

Configuration

#
# The Configuration file of Death Chest
#    In this file you can customize the plugin.
#

# I recommend leaving this on true to receive notification if I published an update.
update-checker: true
auto-update: true

# Uses the Duration Format Utils class from the Apache lang dependency
# https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/DurationFormatUtils.html
duration-format: 'mm:ss'

chest:
  # The expiration of the chest in seconds.
  # You can deactivate the expiration by setting the value to -1
  expiration: -1
  no-expiration-permission:
    enabled: false
    permission: 'deathchest.stays-forever'
  # If this feature is enabled all caught items will be dropped if the chest has expired.
  drop-items-after-expiration: false
  # Set this option to true if you want to protect the death chests against explosions.
  blast-protection: trues

  # This option protects the death chest against thieves if the player has the specific permission and the thief
  # not the bypass permission.
  thief-protection:
    # Set the value to 'true' if you want to activate this feature
    enabled: true
    permission: 'deathchest.thiefprotected'
    bypass-permission: 'deathchest.thiefprotected.bypass'
    # To enable the expiration set the number to number greater than 0. The unit of this variable is seconds.
    expiration: 0
    # On this website you can find a list of all sounds which is implemented in SpigotMC
    # @see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
    # If you want to disable the sound or the message, you can delete these options
    sound: BLOCK_CHEST_LOCKED;1.0;1.0
    message: |-
      &cYou are not permitted to open this chest

# Here you can modify the inventory which opens when you right-click the death chest. You can use color codes with '&'
# in the title and change the inventory size by changing the size value.
inventory:
  # Here you can use the Placeholder API and
  #   ${player_name}: Name
  #   ${player_displayname}: Displayname
  #   ${duration}: Time left
  title: 'Death Chest'
  # Possible values are: 'constant' and 'flexible'
  # constant: the size of the inventory is always 45 slots large
  # flexible: the size of the inventory depends on the items which had the player in the inventory.
  size: flexible

# This section is for handling the hologram function in this plugin. You can remove this section to disable the feature,
# or you set the 'enabled' option to false
# This feature is only available if you have a supported hologram plugin installed.
hologram:
  # Set the value to 'false' if you want to deactivate this feature
  enabled: true
  # If you add lines you have to increase this value. This values depends on the hologram
  # plugin and the distance between the plugin
  height: 1
  line-height: 0.25
  # Support for ${player_name}: Name
  #             ${player_displayname}: Displayname
  #             ${duration}: Time left
  lines:
    - '&7&lR.I.P'
    - '${player_name}'
    - '&3-&6-&3-&6-&3-&6-&3-'
    - '${duration}'

# This section is for handling the particle function in this plugin. You can remove this section to disable the feature,
# or you set the 'enabled' option to false
particle:
  # Set the value to 'false' if you want to deactivate this feature
  enabled: true
  radius: 1.0
  count: 32
  # Maximum is 20
  speed: 20.0

# This section is for handling the block breaking function in this plugin. You can remove this section to disable the feature,
# or you set the 'enabled' option to false
# This feature is only available if you have ProtocolLib installed.
break-effect:
  # Set the value to 'false' if you want to deactivate this feature
  enabled: true
  view-distance: 20.0

# This section is for handling the notification function in this plugin. You can remove this section to disable the feature,
# or you set the 'enabled' option to false.
# This feature sends a message to the dead player. Here you can inform the player about the chest and their expiration.
# You can send the death coordination by using the placeholders: ${x} ${y}, ${z}, ${world} and ${world_alias}
# Also you can send the chest coordination by using the placeholders: ${chest_x}, ${chest_y} and ${chest_z}
player-notification:
  # Set the value to 'false' if you want to deactivate this feature
  enabled: true
  message: |-
    &7You died. Your items were put into a chest which disappears after &c10 minutes&7! ${x} ${y} ${z}

# Available Placeholders:
# ${player_name} : shows the player name
# ${player_displayname} : shows the player display name (Maybe with prefix)
# ${x}, ${y}, ${z}, ${world} : shows the coordinates of the death location
# ${world_alias} : shows the alias of the world (see world-alias section)
# ${chest_x}, ${chest_y}, ${chest_z} : shows the coordinates of the chest
global-notification:
  # Set the value to 'true' if you want to activate this feature
  enabled: false
  message: |-
    &7${player_name} died at ${x} ${y} ${z} in ${world}

# Available Placeholders:
# ${player_name} : shows the player name
# ${player_displayname} : shows the player display name (Maybe with prefix)
# ${x}, ${y}, ${z}, ${world} : shows the coordinates of the death location
# ${world_alias} : shows the alias of the world (see world-alias section)
# (coordinates of the chest isn't available for here)
# To disable the death message change "enabled" to true and remove the message option.
change-death-message:
  # Set the value to 'true' if you want to activate this feature
  enabled: false
  message: |-
    &7${player_name} died at ${x} ${y} ${z} in ${world}

# This section configures the activation of this plugin for specific worlds.
world-filter:
  # Possible values: blacklist, whitelist
  filter: blacklist
  worlds:
    - disabled_world

world-chest-protection-filter:
  filter: blacklist
  worlds:
    - disabled_world

world-alias:
  world: "World"
  world_nether: "Nether"
  world_the_end: "The End"

# Do not touch this!
config-version: 3
# Prints debug messages if property is set to true
debug: false

Additional context
i'll make a pull request to fix this once i get around to it (EDIT: and once i understand how it's bypassing the checks to prevent this exact thing)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions