Gravestones 1.8

Custom gravestones to save your items on death.

  1. asenthd
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    Gravestones
    Gravestones is a plugin designed for Survival/Factions servers looking to offer the ability to re-obtain one's items without the chance of them de-spawning. When the Gravestone is right-clicked it displays information about the Gravestone such as the Player, the death message (based off of your death message system), and the date/time they died.

    It will also let them know on death that a Gravestone has been created at their previous death location, and send them the coordinates.

    If a player dies while seeking their gravestone, their previous gravestone will be destroyed and their items will be dropped.

    If the server closes while players have active gravestones, they will be serialized into a YML and re-created when the player rejoins.

    Servers Using Gravestones:
    NoNonsense (1.16.1)

    API:
    The plugin does have an API for developers to use, in order to access it you must access the GravestoneManager, an instance of it can be found in my Main class unless you need a new instance.


    Code (Java):
    package com.prophaze.gravestones.storage;

    import com.prophaze.gravestones.Main;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;

    public class GravestoneCommand implements CommandExecutor {

        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(sender instanceof Player) {
                Player player = (Player)sender;
                Main.getGravestoneManager().createGravestone(player.getLocation(), player, "N/A", new List<ItemStack>);
            }
            return false;
        }

    }

    Code (Java):

    package com.prophaze.gravestones.storage;

    import com.prophaze.gravestones.Main;
    import com.prophaze.gravestones.utilities.ChatUtils;
    import org.bukkit.Location;
    import org.bukkit.entity.Player;
    import org.bukkit.inventory.ItemStack;

    import java.util.Collections;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;

    public class GravestoneManager {

        private final Set<Gravestone> gravestones;

        public GravestoneManager() {
            this.gravestones = new HashSet<>();
        }

        public boolean hasGraveStone(Player player) {
            for(Gravestone gravestone : gravestones) {
                return gravestone.getPlayer().equals(player);
            }
            return false;
        }

        public Gravestone getGraveStone(Player player) {
            return gravestones.stream().filter(gravestone -> gravestone.getPlayer().equals(player)).findFirst().orElse(null);
        }

        public Gravestone getGraveStone(Location loc) {
            return gravestones.stream().filter(gravestone -> gravestone.getLocation().equals(loc)).findFirst().orElse(null);
        }

        public int graveStoneCount() {
            return gravestones.size();
        }

        public Set<Gravestone> getGravestones() {
            return Collections.unmodifiableSet(gravestones);
        }

        public void addGravestone(Gravestone gravestone) {
            this.gravestones.add(gravestone);
        }

        public void removeGravestone(Gravestone gravestone) {
            this.gravestones.remove(gravestone);
        }

        public Gravestone createGravestone(Location loc, Player player, String deathMessage, List<ItemStack> contents) {
            if(hasGraveStone(player)) deleteGravestone(getGraveStone(player));
            Gravestone stone = new Gravestone(loc, player, deathMessage);
            stone.addItems(contents);
            return stone;
        }

        public void deleteGravestone(Gravestone gravestone) {
            if(gravestone != null) {
                if(gravestone.getPlayer().isOnline()) gravestone.getPlayer().sendMessage(ChatUtils
                        .replaceVariables(Main.getInstance().getConfig().getString("broke-old"), gravestone));
                gravestone.dropItems();
                removeGravestone(gravestone);
                gravestone.getLocation().getBlock().setType(gravestone.getPreviousBlock());
            }
        }

    }
     

Recent Updates

  1. Update V1.8
  2. Update V1.6
  3. Update V1.5

Recent Reviews

  1. fergydanny
    fergydanny
    5/5,
    Version: 1.8
    Great plugin however beware if you use any enchantments over vanilla level as the plugin will not load if it has a saved gravestone with a non vanilla level enchant.

    This is because it uses ItemStack#addEnchantment instead of ItemStack#addUnsafeEnchantment (incase dev wants to fix public release)
    1. asenthd
      Author's Response
      Hi, thank you so much for your review, I've made note of the bug mentioned, the server I developed this resource for was a semi-vanilla SMP, so non-vanilla enchantments weren't supported.

      On a positive note the process is currently undergoing a re-code, I lost a lot of the original source figured I can improve it by taking another go at it. This will be included in the next update, thanks again fergy :)
  2. NickBarnum
    NickBarnum
    5/5,
    Version: 1.8
    Great plugin, do you have a discord either a server or an account I can talk to you on?
  3. Dim2000
    Dim2000
    5/5,
    Version: 1.8
    The Perfect Plugin I searched for! If u die it spawns a beakon u need to break to get ur loot and it tells the cords where u died
  4. TommyGunGO
    TommyGunGO
    5/5,
    Version: 1.3
    This plugin was was originally developed for my server a year ago, and i have used it on every SMP since, i love the plugin, because of the versatility, and the usability with new players who dont know much about the game. Also the author of the plugin is a cutie ;3
  5. arduino
    arduino
    5/5,
    Version: 1.2
    Love this plugin, will this be updated for 1.16?

    There are times when it doesn't tell anyone the location of players gravestone.
    1. asenthd
      Author's Response
      Update 1.3 has 1.16 support as well as updates to messages (They will send every time) and an updated API
  6. ComputerPassword
    ComputerPassword
    5/5,
    Version: 1.1
    This plugin offers a unique way for someones items to be given back to the user after death. Great plugin and great author!
    1. asenthd
      Author's Response
      Thank you a ton :D