Class BlockLootSubProvider
java.lang.Object
net.minecraft.data.loot.BlockLootSubProvider
- All Implemented Interfaces:
LootTableSubProvider, LootTableSubProviderExtension
- Direct Known Subclasses:
VanillaBlockLoot
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FeatureFlagSetprivate final Map<ResourceKey<LootTable>, LootTable.Builder> protected static final float[]private static final float[]protected final HolderLookup.Provider -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockLootSubProvider(Set<Item> explosionResistant, FeatureFlagSet enabledFeatures, HolderLookup.Provider registries) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadd(Block block, Function<Block, LootTable.Builder> builder) protected voidadd(Block block, LootTable.Builder builder) protected voidaddNetherVinesDropTable(Block vineBlock, Block plantBlock) protected <T extends ConditionUserBuilder<T>>
TapplyExplosionCondition(ItemLike type, ConditionUserBuilder<T> builder) protected <T extends FunctionUserBuilder<T>>
TapplyExplosionDecay(ItemLike type, FunctionUserBuilder<T> builder) createAttachedStemDrops(Block block, Item drop) protected LootTable.BuildercreateBannerDrop(Block original) protected LootTable.BuildercreateBeeHiveDrop(Block original) protected LootTable.BuildercreateBeeNestDrop(Block original) protected static LootTable.BuildercreateCandleCakeDrops(Block candle) protected LootTable.BuildercreateCandleDrops(Block block) protected LootTable.BuildercreateCaveVinesDrop(Block original) protected LootTable.Builderprotected LootTable.BuildercreateCopperOreDrops(Block block) protected LootTable.BuildercreateCropDrops(Block original, Item cropDrop, Item seedDrop, LootItemCondition.Builder isMaxAge) IfdropGrownCropConditionfails (i.e. crop is not ready), drops 1seedsItem.protected LootTable.BuildercreateDoorTable(Block block) protected LootTable.BuildercreateDoublePlantShearsDrop(Block block) protected LootTable.BuildercreateDoublePlantWithSeedDrops(Block block, Block drop) protected LootTable.BuildercreateGrassDrops(Block original) protected LootTable.BuildercreateLapisOreDrops(Block block) protected LootTable.BuildercreateLeavesDrops(Block original, Block sapling, float... saplingChances) Used for all leaves, drops self with silk touch, otherwise drops the second Block param with the passed chances for fortune levels, adding in sticks.protected LootTable.BuildercreateMangroveLeavesDrops(Block block) protected LootTable.BuildercreateMossyCarpetBlockDrops(Block block) protected LootTable.BuildercreateMultifaceBlockDrops(Block block) protected LootTable.BuildercreateMultifaceBlockDrops(Block block, LootItemCondition.Builder condition) protected LootTable.BuildercreateMushroomBlockDrop(Block original, ItemLike drop) protected LootTable.Builderprotected LootTable.BuildercreateOakLeavesDrops(Block original, Block sapling, float... saplingChances) Used for oak and dark oak, same as droppingWithChancesAndSticks but adding in apples.protected LootTable.BuildercreateOreDrop(Block original, Item drop) protected LootTable.BuildercreatePotFlowerItemTable(ItemLike flower) protected LootTable.BuildercreateRedstoneOreDrops(Block block) createSegmentedBlockDrops(Block block) protected static LootTable.BuildercreateSelfDropDispatchTable(Block original, LootItemCondition.Builder condition, LootPoolEntryContainer.Builder<?> entry) If the condition fromconditionBuildersucceeds, drops 1block.protected LootTable.BuildercreateShearsDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined with Shears, drops 1block.protected LootTable.BuildercreateShearsOnlyDrop(ItemLike drop) protected LootTable.Builderprotected LootTable.BuildercreateShulkerBoxDrop(Block shulkerBox) protected LootTable.BuildercreateSilkTouchDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined with Silk Touch, drops 1block.protected LootTable.Builderprotected LootTable.BuildercreateSilkTouchOrShearsDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined either with Silk Touch or Shears, drops 1block.protected LootTable.BuildercreateSingleItemTable(ItemLike drop, NumberProvider count) protected LootTable.BuildercreateSingleItemTableWithSilkTouch(Block original, ItemLike drop) protected LootTable.BuildercreateSingleItemTableWithSilkTouch(Block original, ItemLike drop, NumberProvider count) protected <T extends Comparable<T> & StringRepresentable>
LootTable.BuildercreateSinglePropConditionTable(Block drop, Property<T> property, T value) protected LootTable.BuildercreateSlabItemTable(Block slab) createStemDrops(Block block, Item drop) Creates a builder that drops the given IItemProvider in amounts between 0 and 3, based on the AGE property.private LootItemCondition.Builderprotected LootItemCondition.Builderprotected voidprotected voiddropPottedContents(Block potted) protected voidprotected voiddropWhenSilkTouch(Block block) protected abstract voidgenerate()voidgenerate(BiConsumer<ResourceKey<LootTable>, LootTable.Builder> output) protected LootItemCondition.Builderprivate LootItemCondition.Builderprotected LootItemCondition.Builderstatic LootTable.BuildernoDrop()protected voidotherWhenSilkTouch(Block block, Block other) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LootTableSubProviderExtension
withConditions
-
Field Details
-
registries
-
explosionResistant
-
enabledFeatures
-
map
-
NORMAL_LEAVES_SAPLING_CHANCES
protected static final float[] NORMAL_LEAVES_SAPLING_CHANCES -
NORMAL_LEAVES_STICK_CHANCES
private static final float[] NORMAL_LEAVES_STICK_CHANCES
-
-
Constructor Details
-
BlockLootSubProvider
protected BlockLootSubProvider(Set<Item> explosionResistant, FeatureFlagSet enabledFeatures, HolderLookup.Provider registries)
-
-
Method Details
-
hasSilkTouch
-
doesNotHaveSilkTouch
-
hasShears
-
hasShearsOrSilkTouch
-
doesNotHaveShearsOrSilkTouch
-
applyExplosionDecay
protected <T extends FunctionUserBuilder<T>> T applyExplosionDecay(ItemLike type, FunctionUserBuilder<T> builder) -
applyExplosionCondition
protected <T extends ConditionUserBuilder<T>> T applyExplosionCondition(ItemLike type, ConditionUserBuilder<T> builder) -
createSingleItemTable
-
createSelfDropDispatchTable
protected static LootTable.Builder createSelfDropDispatchTable(Block original, LootItemCondition.Builder condition, LootPoolEntryContainer.Builder<?> entry) If the condition fromconditionBuildersucceeds, drops 1block. Otherwise, drops loot specified byalternativeBuilder. -
createSilkTouchDispatchTable
protected LootTable.Builder createSilkTouchDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined with Silk Touch, drops 1block. Otherwise, drops loot specified bybuilder. -
createShearsDispatchTable
protected LootTable.Builder createShearsDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined with Shears, drops 1block. Otherwise, drops loot specified bybuilder. -
createSilkTouchOrShearsDispatchTable
protected LootTable.Builder createSilkTouchOrShearsDispatchTable(Block original, LootPoolEntryContainer.Builder<?> entry) If the block is mined either with Silk Touch or Shears, drops 1block. Otherwise, drops loot specified bybuilder. -
createSingleItemTableWithSilkTouch
-
createSingleItemTable
-
createSingleItemTableWithSilkTouch
protected LootTable.Builder createSingleItemTableWithSilkTouch(Block original, ItemLike drop, NumberProvider count) -
createSilkTouchOnlyTable
-
createPotFlowerItemTable
-
createSlabItemTable
-
createSinglePropConditionTable
protected <T extends Comparable<T> & StringRepresentable> LootTable.Builder createSinglePropConditionTable(Block drop, Property<T> property, T value) -
createNameableBlockEntityTable
-
createShulkerBoxDrop
-
createCopperOreDrops
-
createLapisOreDrops
-
createRedstoneOreDrops
-
createBannerDrop
-
createBeeNestDrop
-
createBeeHiveDrop
-
createCaveVinesDrop
-
createCopperGolemStatueBlock
-
createOreDrop
-
createMushroomBlockDrop
-
createGrassDrops
-
createStemDrops
Creates a builder that drops the given IItemProvider in amounts between 0 and 3, based on the AGE property. Only used in vanilla for pumpkin and melon stems. -
createAttachedStemDrops
-
createShearsOnlyDrop
-
createShearsOrSilkTouchOnlyDrop
-
createMultifaceBlockDrops
protected LootTable.Builder createMultifaceBlockDrops(Block block, LootItemCondition.Builder condition) -
createMultifaceBlockDrops
-
createMossyCarpetBlockDrops
-
createLeavesDrops
protected LootTable.Builder createLeavesDrops(Block original, Block sapling, float... saplingChances) Used for all leaves, drops self with silk touch, otherwise drops the second Block param with the passed chances for fortune levels, adding in sticks. -
createOakLeavesDrops
protected LootTable.Builder createOakLeavesDrops(Block original, Block sapling, float... saplingChances) Used for oak and dark oak, same as droppingWithChancesAndSticks but adding in apples. -
createMangroveLeavesDrops
-
createCropDrops
protected LootTable.Builder createCropDrops(Block original, Item cropDrop, Item seedDrop, LootItemCondition.Builder isMaxAge) IfdropGrownCropConditionfails (i.e. crop is not ready), drops 1seedsItem. IfdropGrownCropConditionsucceeds (i.e. crop is ready), drops 1grownCropItem, and 0-3seedsItemwith fortune applied. -
createDoublePlantShearsDrop
-
createDoublePlantWithSeedDrops
-
createCandleDrops
-
createSegmentedBlockDrops
-
createCandleCakeDrops
-
noDrop
-
generate
protected abstract void generate() -
getKnownBlocks
-
generate
- Specified by:
generatein interfaceLootTableSubProvider
-
addNetherVinesDropTable
-
createDoorTable
-
dropPottedContents
-
otherWhenSilkTouch
-
dropOther
-
dropWhenSilkTouch
-
dropSelf
-
add
-
add
-