程序包 org.bukkit.loot

接口 Lootable

所有已知子接口:
AbstractHorse, AbstractSkeleton, AbstractVillager, Ageable, Allay, Ambient, Animals, Armadillo, Axolotl, Barrel, Bat, Bee, Blaze, Bogged, Breedable, Breeze, BrushableBlock, Camel, Cat, CaveSpider, Chest, ChestBoat, ChestedHorse, Chicken, Cod, Cow, Crafter, Creature, Creeper, Dispenser, Dolphin, Donkey, Dropper, Drowned, ElderGuardian, EnderDragon, Enderman, Endermite, Evoker, Fish, Flying, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, Hoglin, Hopper, HopperMinecart, Horse, Husk, Illager, Illusioner, IronGolem, Llama, MagmaCube, Mob, Monster, Mule, MushroomCow, NPC, Ocelot, Panda, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, PolarBear, PufferFish, Rabbit, Raider, Ravager, Salmon, Sheep, Shulker, ShulkerBox, Silverfish, Skeleton, SkeletonHorse, Slime, Sniffer, Snowman, Spellcaster, Spider, 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
Represents a Container or a Mob that can have a loot table.
Container loot will only generate upon opening, and only when the container is first opened.
Entities will only generate loot upon death.
  • 方法概要

    修饰符和类型
    方法
    说明
    Gets the Loot Table attached to this block or entity.
    long
    Get the Loot Table's seed.
    void
    Set the loot table for a container or entity.
    void
    setSeed(long seed)
    Set the seed used when this Loot Table generates loot.
  • 方法详细资料

    • setLootTable

      void setLootTable(@Nullable @Nullable LootTable table)
      Set the loot table for a container or entity.
      To remove a loot table use null. Do not use LootTables.EMPTY to clear a LootTable.
      参数:
      table - the Loot Table this Container or Mob will have.
    • getLootTable

      @Nullable @Nullable 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.
      返回:
      the Loot Table attached to this block or entity.
    • setSeed

      void setSeed(long seed)
      Set the seed used when this Loot Table generates loot.
      参数:
      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.
      返回:
      the seed