Skip to Content
PluginsAquaGravesDeveloper API

Developer API

AquaGraves registers AquaGravesAPI as a Bukkit service. Grab it once your plugin enables.

plugin.yml
softdepend: [AquaGraves]

Depend on it at compile time only. The plugin ships the implementation at runtime, so shading it will break your add on.

Install

build.gradle.kts
repositories { maven("https://jitpack.io") } dependencies { compileOnly("com.github.aquatic-studios:AquaGraves:VERSION") }

Getting it

AquaGravesAPI api = AquaGravesAPI.get(); if (api == null) return;

get() returns null while AquaGraves is not enabled.

Reading

MethodReturns
graves()Every grave in the world
gravesOf(UUID owner) / gravesOf(OfflinePlayer owner)That player’s graves, newest first
graveCount()How many graves exist
grave(UUID id)One by id, or null
graveAt(Location location)The grave at that block, or null
gravesNear(Location center, double radius)Graves around a point, closest first
graveLimit(Player player)Their limit, -1 when unlimited
protectionSeconds(Player player)How long their graves stay locked
for (Grave grave : api.gravesOf(player)) { getLogger().info(grave.ownerName() + " " + grave.itemCount() + " items at " + grave.location()); }

Writing

Grave grave = api.createGrave( location, player, items, 250, 120);
MethodDoes
createGrave(location, owner, items, storedXp, protectionSeconds)Spawns a grave. A protectionSeconds of 0 or less locks it for its whole life
removeGrave(grave)Removes it with the PLUGIN reason, dropping its contents

Grave

MethodReturns
id()Its id
ownerId() / ownerName() / owner()The owner
world() / location()Where it is
createdAt()When it spawned, in milliseconds
inventory()The inventory behind the GUI
storedXp()Experience inside
itemCount() / stackCount() / isEmpty()What is inside
remainingMillis()Time until it despawns
isProtected()Whether it is still locked
isRemoved()Whether it is gone
canAccess(Player player)Whether that player may open it
open(Player player)Opens the GUI for them
loot(Player player)Gives them everything at once
remove(RemoveReason reason)Removes it

Remove reasons

ReasonDrops the contentsKeeps a backup
EXPIREDYesYes
PROTECTION_EXPIREDYesYes
EMPTIEDNoNo
LIMITYesYes
COMMANDYesYes
PURGENoYes
PLUGINYesYes

Drops follow drop-items-on-despawn, and backups need storage.backups.enabled.

Events

EventFiresCancellable
GravePreSpawnEventA player died and a grave is about to spawnYes
GraveSpawnEventThe grave spawned from a death. Not fired by createGraveNo
GraveOpenEventA player opens the GUIYes
GraveLootEventA player takes everything with shift + right clickYes
GraveUnlockEventThe protection ran out and the grave opened to everyone. Not fired with on-expire: REMOVENo
EventGives
GravePreSpawnEventgetPlayer(), getLocation(), setLocation(Location)
GraveSpawnEventgetPlayer(), getGrave()
GraveOpenEvent / GraveLootEventgetPlayer(), getGrave()
GraveUnlockEventgetGrave()

Every event except GravePreSpawnEvent extends GraveEvent.

@EventHandler public void onPreSpawn(GravePreSpawnEvent event) { if (event.getLocation().getWorld().getName().equals("arena")) { event.setCancelled(true); } }

Cancelling GravePreSpawnEvent leaves the drops to vanilla, and setLocation moves the grave somewhere else.

Last updated: October 16, 2026 bySenkexin69046c7