Interface LootableInventory
- All Superinterfaces:
- Lootable
- All Known Subinterfaces:
- Barrel,- Chest,- ChestBoat,- Dispenser,- Dropper,- Hopper,- HopperMinecart,- LootableBlockInventory,- LootableEntityInventory,- ShulkerBox,- StorageMinecart
Represents an Inventory that contains a Loot Table associated to it that will
 automatically fill on first open.
 A new feature and API is provided to support automatically refreshing the contents
 of the inventory based on that Loot Table after a configurable amount of time has passed.
 The behavior of how the Inventory is filled based on the loot table may vary based
 on Minecraft versions and the Loot Table feature.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanPlayerLoot(@NotNull UUID player) Checks if this player can loot this block.longGets the timestamp in milliseconds that the Lootable object was last refilledgetLastLooted(@NotNull UUID player) Gets the timestamp, in milliseconds, of when the player last looted this objectgetLastLooted(@NotNull Player player) Gets the timestamp, in milliseconds, of when the player last looted this objectlongGets the timestamp in milliseconds that the Lootable object will refillbooleanWhether or not this object has ever been filledbooleanReturns Whether or not this object has been filled and now has a pending refillbooleanhasPlayerLooted(@NotNull UUID player) Has this player ever looted this blockdefault booleanhasPlayerLooted(@NotNull Player player) Has this player ever looted this blockbooleanServer owners have to enable whether or not an object in a world should refillbooleansetHasPlayerLooted(@NotNull UUID player, boolean looted) Change the state of whether or not a player has looted this blockdefault booleansetHasPlayerLooted(@NotNull Player player, boolean looted) Change the state of whether or not a player has looted this blocklongsetNextRefill(long refillAt) Sets the timestamp in milliseconds of the next refill for this objectMethods inherited from interface org.bukkit.loot.LootableclearLootTable, getLootTable, getSeed, hasLootTable, setLootTable, setLootTable, setSeed
- 
Method Details- 
isRefillEnabledboolean isRefillEnabled()Server owners have to enable whether or not an object in a world should refill- Returns:
- If the world this inventory is currently in has Replenishable Lootables enabled
 
- 
hasBeenFilledboolean hasBeenFilled()Whether or not this object has ever been filled- Returns:
- Has ever been filled
 
- 
hasPlayerLootedHas this player ever looted this block- Parameters:
- player- The player to check
- Returns:
- Whether or not this player has looted this block
 
- 
canPlayerLootChecks if this player can loot this block. Takes into account the "restrict player reloot" settings- Parameters:
- player- the player to check
- Returns:
- Whether this player can loot this block
 
- 
hasPlayerLootedHas this player ever looted this block- Parameters:
- player- The player to check
- Returns:
- Whether or not this player has looted this block
 
- 
getLastLootedGets the timestamp, in milliseconds, of when the player last looted this object- Parameters:
- player- The player to check
- Returns:
- Timestamp last looted, or null if player has not looted this object
 
- 
getLastLootedGets the timestamp, in milliseconds, of when the player last looted this object- Parameters:
- player- The player to check
- Returns:
- Timestamp last looted, or null if player has not looted this object
 
- 
setHasPlayerLootedChange the state of whether or not a player has looted this block- Parameters:
- player- The player to change state for
- looted- true to add player to looted list, false to remove
- Returns:
- The previous state of whether the player had looted this or not
 
- 
setHasPlayerLootedChange the state of whether or not a player has looted this block- Parameters:
- player- The player to change state for
- looted- true to add player to looted list, false to remove
- Returns:
- The previous state of whether the player had looted this or not
 
- 
hasPendingRefillboolean hasPendingRefill()Returns Whether or not this object has been filled and now has a pending refill- Returns:
- Has pending refill
 
- 
getLastFilledlong getLastFilled()Gets the timestamp in milliseconds that the Lootable object was last refilled- Returns:
- -1 if it was never refilled, or timestamp in milliseconds
 
- 
getNextRefilllong getNextRefill()Gets the timestamp in milliseconds that the Lootable object will refill- Returns:
- -1 if it is not scheduled for refill, or timestamp in milliseconds
 
- 
setNextRefilllong setNextRefill(long refillAt) Sets the timestamp in milliseconds of the next refill for this object- Parameters:
- refillAt- timestamp in milliseconds. -1 to clear next refill
- Returns:
- The previous scheduled time to refill, or -1 if was not scheduled
 
 
-