Package org.bukkit.loot
Interface Lootable
- All Known Subinterfaces:
AbstractHorse
,AbstractVillager
,Ageable
,Ambient
,Animals
,Barrel
,Bat
,Bee
,Blaze
,Breedable
,Cat
,CaveSpider
,Chest
,ChestedHorse
,Chicken
,Cod
,Cow
,Creature
,Creeper
,Dispenser
,Dolphin
,Donkey
,Dropper
,Drowned
,ElderGuardian
,EnderDragon
,Enderman
,Endermite
,Evoker
,Fish
,Flying
,Fox
,Ghast
,Giant
,Golem
,Guardian
,Hoglin
,Hopper
,HopperMinecart
,Horse
,Husk
,Illager
,Illusioner
,IronGolem
,Llama
,LootableBlockInventory
,LootableEntityInventory
,LootableInventory
,MagmaCube
,Mob
,Monster
,Mule
,MushroomCow
,NPC
,Ocelot
,Panda
,Parrot
,Phantom
,Pig
,Piglin
,PiglinAbstract
,PiglinBrute
,PigZombie
,Pillager
,PolarBear
,PufferFish
,Rabbit
,Raider
,RangedEntity
,Ravager
,Salmon
,Sheep
,Shulker
,ShulkerBox
,Silverfish
,Skeleton
,SkeletonHorse
,Slime
,Snowman
,Spellcaster
,Spider
,Squid
,Steerable
,StorageMinecart
,Stray
,Strider
,Tameable
,TraderLlama
,TropicalFish
,Turtle
,Vex
,Villager
,Vindicator
,WanderingTrader
,WaterMob
,Witch
,Wither
,WitherSkeleton
,Wolf
,Zoglin
,Zombie
,ZombieHorse
,ZombieVillager
public interface Lootable
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Clears the associated Loot Table to this objectGets the Loot Table attached to this block or entity.long
getSeed()
Get the Loot Table's seed.default boolean
Returns whether or not this object has a Loot Tablevoid
setLootTable(@Nullable LootTable table)
Set the loot table for a container or entity.default void
setLootTable(@Nullable LootTable table, long seed)
Set the loot table and seed for a container or entity at the same time.void
setSeed(long seed)
Set the seed used when this Loot Table generates loot.
-
Method Details
-
setLootTable
Set the loot table for a container or entity.
To remove a loot table use null. Do not useLootTables.EMPTY
to clear a LootTable. -
getLootTable
Gets the Loot Table attached to this block or entity.
If an block/entity does not have a loot table, this will return null, NOT an empty loot table.- Returns:
- the Loot Table attached to this block or entity.
-
setLootTable
Set the loot table and seed for a container or entity at the same time. -
hasLootTable
default boolean hasLootTable()Returns whether or not this object has a Loot Table- Returns:
- Has a loot table
-
clearLootTable
default void clearLootTable()Clears the associated Loot Table to this object -
setSeed
void setSeed(long seed)Set the seed used when this Loot Table generates loot.- Parameters:
seed
- the seed to used to generate loot. Default is 0.
-
getSeed
long getSeed()Get the Loot Table's seed.
The seed is used when generating loot.- Returns:
- the seed
-