Overview

SavageDeathCompass

Table of Contents

Description:

This plugin was created as an alternative to the /back on death command. With DeathCompass enabled, a player is given a compass when they respawn after death. This compass points to their last death location in that world, so they can find their dropped loot. It also works well alongside various death chest and graveyard plugins.

Features:

Customizable item name, supports color codes

Customizable item lore with color codes

Customizable messages with variable substitution

Option to disable messages individually

Localization files for messages, item name and lore. default is English, with Spanish and German examples included. If you'd like to improve my translations, or submit a new language file for inclusion in subsequent versions, please PM me!

Permissions for use and admin commands

Configurable for which worlds the plugin is enabled

stores last death locations for each world so they are persistent when changing worlds, logging out/in, and server restarts

Uses SQLite for persistent storage

Configurable option to destroy compass on drop, to keep them from cluttering your world. Also destroys compass on death drop if configured

Configurable delay for setting compass target for better compatibility with other plugins that react to player respawn events

Destroys compass on any interaction with SavageDeathChests owned by player

Configurable option to prevent placing death compass in chests/containers

Installation:

Place the jar file in your server plugins folder and restart the server.

Open the config.yml file with your favorite text editor, and add any worlds in which you would like the plugin to be active to the enabled-worlds section, and make any other configuration changes you desire.

Issue the /deathcompass reload command; restarting the server is not necessary for configuration changes to take effect

Remember to grant any players or groups that should receive death compasses the deathcompass.use permission node, and any administrators of the plugin the deathcompass.admin permission node.

Source Code:

Comments

Suggestion to make it so that if a death compass it attempted to be dropped in a worldguard region where item-drop is set to deny and compass is set to destroy on drop, to not display the compass has been detroyed message because worlguard has cancelled the drop event after that message is sent but before the destroy event from savagedeathcompass is triggered

I also suggest adding an option so that ytou can set a delay as to when to give the compass to the player instead of straight away and another option to make it it give the compass to the player when they 1st attempt to move after re-spawning. I added these requests/suggestions so that it would help make it more compatible with another plugin I'm using which can have bossbar issues if the compass is given too early. But all g if u don't wanna add it

A new version (v1.13.4) has been uploaded. This is a maintenance release that addresses an issue where an NPE was thrown any time a player changed worlds. Thanks goes to ZethrusTV for bringing this to my attention.

Does the prevent storage option prevent the compass falling into hoppers/hopper minecarts? If not I suggest adding this and I also suggest adding the option to destroy the compass when the players is within a set radius of their death location depending on what's set in config.And to also add an option to remove the compass after a set amount of time aswell ;)

Yes, the prevent storage option does prevent the death compass from being inserted into containers by hoppers, and any other means I could think of. If you discover a way to cheat this behavior, let me know and I'll add appropriate checks to prevent the cheat.

I'll consider adding the expiring compass features in a future version. The problem with proximity detection is that you have to run a repeating task that cycles through all online players, and tests the distance for each on every cycle. This is not an inexpensive task, and could conceivably lead to lag on a busy server.

If used in conjunction with SavageDeathChests, the death compass is removed from player inventory on any interaction with the death chest.

Even the timed expiration feature is a bit more complicated to implement than it would appear, as the expire times would have to be saved to persistent storage in order to work properly across server restarts and player logout/logins. Not that hard to do, but not trivial.

A new version (v1.13.3) has been uploaded. This is a maintenance release that fixes a bug that sometimes prevented items from being rearranged in inventories.

Also addressed a bug that prevented the plugin from working when a user supplied language file was used. The embedded english language resource file will now be used as a fallback when a message can not be found in a user supplied language file.

There have been no changes made to any configuration or language files.

For some reason the plugin occasionally says that the death compass cannot be placed in containers even though the player was not carrying a death compass, instead was just trying to use an anvil or place an item into a chest or take an item out.

EDIT: Noticed this seems to occur when dragging and dropping items in stacks of more than 1. If you place item in singular stack before moving to chest, anvil etc, You do not get the error.

Any idea whats up with this? Using the latest version, it only happens occasionally.

A replacement version (v1.13.2) has been uploaded that fixes the bug that prevented players from rearranging items in inventories when this plugin is active. There have been no changes to any configuration files, so simply replacing the plugin jar is all that is required.

A new version has been uploaded and will be available for download once approved that should fix this issue.

Can you tell me, are you using any of my other plugins? I believe this error is due to a versioning conflict with the embedded libraries used by my plugins, and should be solved for all new versions henceforth.

A new version (v1.13.1) has been uploaded. This version removes the (buggy) yaml storage option, so the plugin always uses a SQLite database for persistent storage. A configurable option to prevent placing death compasses in chests/containers has been added, as well as configurable sound effects in the sounds.yml file.

Note that fields names in the config.yml and language/*.yml files have changed. Please remove these files and restart your server to allow the plugin to install the new versions.