Package org.bukkit.loot
Interface Lootable
- All Known Subinterfaces:
AbstractCow,AbstractHorse,AbstractSkeleton,AbstractVillager,AcaciaChestBoat,Ageable,Allay,Ambient,Animals,Armadillo,Axolotl,BambooChestRaft,Barrel,Bat,Bee,BirchChestBoat,Blaze,Bogged,Breedable,Breeze,BrushableBlock,Camel,Cat,CaveSpider,CherryChestBoat,Chest,ChestBoat,ChestedHorse,Chicken,Cod,Cow,Crafter,Creaking,Creature,Creeper,DarkOakChestBoat,DecoratedPot,Dispenser,Dolphin,Donkey,Dropper,Drowned,ElderGuardian,EnderDragon,Enderman,Endermite,Evoker,Fish,Flying,Fox,Frog,Ghast,Giant,GlowSquid,Goat,Golem,Guardian,HappyGhast,Hoglin,Hopper,HopperMinecart,Horse,Husk,Illager,Illusioner,IronGolem,JungleChestBoat,Llama,LootableBlockInventory,LootableEntityInventory,LootableInventory,MagmaCube,MangroveChestBoat,Mob,Monster,Mule,MushroomCow,NPC,OakChestBoat,Ocelot,PaleOakChestBoat,Panda,Parrot,Phantom,Pig,Piglin,PiglinAbstract,PiglinBrute,PigZombie,Pillager,PolarBear,PufferFish,Rabbit,Raider,RangedEntity,Ravager,Salmon,SchoolableFish,Sheep,Shulker,ShulkerBox,Silverfish,Skeleton,SkeletonHorse,Slime,Sniffer,Snowman,Spellcaster,Spider,SpruceChestBoat,Squid,Steerable,StorageMinecart,Stray,Strider,SuspiciousSand,Tadpole,Tameable,TraderLlama,TropicalFish,Turtle,Vex,Villager,Vindicator,WanderingTrader,Warden,WaterMob,Witch,Wither,WitherSkeleton,Wolf,Zoglin,Zombie,ZombieHorse,ZombieVillager
public interface Lootable
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidClears the associated Loot Table to this object, essentially resetting it to defaultGets the Loot Table attached to this block or entity.longgetSeed()Get the Loot Table's seed.default booleanReturns whether or not this object has a Loot TablevoidsetLootTable(@Nullable LootTable table) Set the loot table for a container or entity.voidsetLootTable(@Nullable LootTable table, long seed) Set the loot table and seed for a container or entity at the same time.voidsetSeed(long seed) Set the seed used when this Loot Table generates loot.
-
Method Details
-
setLootTable
Set the loot table for a container or entity.
If the provided loot table is null, the loot table will be reset to its default behavior. -
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.
If the provided loot table is null, the loot table will be reset to its default behavior. -
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, essentially resetting it to default- See Also:
-
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
-