1201 lines
		
	
	
	
		
			45 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			1201 lines
		
	
	
	
		
			45 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.data.loot.packs;
 | |
| 
 | |
| import net.minecraft.advancements.critereon.DamageSourcePredicate;
 | |
| import net.minecraft.advancements.critereon.EntityPredicate;
 | |
| import net.minecraft.advancements.critereon.MinMaxBounds;
 | |
| import net.minecraft.advancements.critereon.RaiderPredicate;
 | |
| import net.minecraft.advancements.critereon.SlimePredicate;
 | |
| import net.minecraft.advancements.critereon.TagPredicate;
 | |
| import net.minecraft.core.HolderGetter;
 | |
| import net.minecraft.core.HolderLookup;
 | |
| import net.minecraft.core.registries.Registries;
 | |
| import net.minecraft.data.loot.EntityLootSubProvider;
 | |
| import net.minecraft.resources.ResourceKey;
 | |
| import net.minecraft.tags.DamageTypeTags;
 | |
| import net.minecraft.tags.EntityTypeTags;
 | |
| import net.minecraft.tags.ItemTags;
 | |
| import net.minecraft.world.entity.EntityType;
 | |
| import net.minecraft.world.entity.animal.frog.FrogVariant;
 | |
| import net.minecraft.world.entity.animal.frog.FrogVariants;
 | |
| import net.minecraft.world.flag.FeatureFlags;
 | |
| import net.minecraft.world.item.Items;
 | |
| import net.minecraft.world.item.alchemy.Potions;
 | |
| import net.minecraft.world.level.block.Blocks;
 | |
| import net.minecraft.world.level.storage.loot.BuiltInLootTables;
 | |
| import net.minecraft.world.level.storage.loot.LootContext;
 | |
| import net.minecraft.world.level.storage.loot.LootPool;
 | |
| import net.minecraft.world.level.storage.loot.LootTable;
 | |
| import net.minecraft.world.level.storage.loot.entries.EmptyLootItem;
 | |
| import net.minecraft.world.level.storage.loot.entries.LootItem;
 | |
| import net.minecraft.world.level.storage.loot.entries.NestedLootTable;
 | |
| import net.minecraft.world.level.storage.loot.entries.TagEntry;
 | |
| import net.minecraft.world.level.storage.loot.functions.EnchantedCountIncreaseFunction;
 | |
| import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
 | |
| import net.minecraft.world.level.storage.loot.functions.SetOminousBottleAmplifierFunction;
 | |
| import net.minecraft.world.level.storage.loot.functions.SetPotionFunction;
 | |
| import net.minecraft.world.level.storage.loot.functions.SmeltItemFunction;
 | |
| import net.minecraft.world.level.storage.loot.predicates.DamageSourceCondition;
 | |
| import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition;
 | |
| import net.minecraft.world.level.storage.loot.predicates.LootItemKilledByPlayerCondition;
 | |
| import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
 | |
| import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceWithEnchantedBonusCondition;
 | |
| import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
 | |
| import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
 | |
| 
 | |
| public class VanillaEntityLoot extends EntityLootSubProvider {
 | |
| 	public VanillaEntityLoot(HolderLookup.Provider registries) {
 | |
| 		super(FeatureFlags.REGISTRY.allFlags(), registries);
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public void generate() {
 | |
| 		HolderGetter<EntityType<?>> holderGetter = this.registries.lookupOrThrow(Registries.ENTITY_TYPE);
 | |
| 		HolderGetter<FrogVariant> holderGetter2 = this.registries.lookupOrThrow(Registries.FROG_VARIANT);
 | |
| 		this.add(EntityType.ALLAY, LootTable.lootTable());
 | |
| 		this.add(EntityType.ARMADILLO, LootTable.lootTable());
 | |
| 		this.add(EntityType.ARMOR_STAND, LootTable.lootTable());
 | |
| 		this.add(EntityType.AXOLOTL, LootTable.lootTable());
 | |
| 		this.add(EntityType.BAT, LootTable.lootTable());
 | |
| 		this.add(EntityType.BEE, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.BLAZE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BLAZE_ROD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.BOGGED,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ARROW)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.TIPPED_ARROW)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)).setLimit(1))
 | |
| 								.apply(SetPotionFunction.setPotion(Potions.POISON))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.CAT,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.STRING).apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.CAMEL, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.CAVE_SPIDER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.STRING)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SPIDER_EYE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(-1.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.CHICKEN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.FEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.CHICKEN)
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.COD,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.COD).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.BONE_MEAL))
 | |
| 						.when(LootItemRandomChanceCondition.randomChance(0.05F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.COW,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BEEF)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.CREEPER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GUNPOWDER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.add(TagEntry.expandTag(ItemTags.CREEPER_DROP_MUSIC_DISCS))
 | |
| 						.when(
 | |
| 							LootItemEntityPropertyCondition.hasProperties(
 | |
| 								LootContext.EntityTarget.ATTACKER, EntityPredicate.Builder.entity().of(holderGetter, EntityTypeTags.SKELETONS)
 | |
| 							)
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.DOLPHIN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.COD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.DONKEY,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.DROWNED,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.COPPER_INGOT))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.11F, 0.02F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.ELDER_GUARDIAN, this.elderGuardianLootTable());
 | |
| 		this.add(EntityType.ENDER_DRAGON, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.ENDERMAN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ENDER_PEARL)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.ENDERMITE, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.EVOKER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(Items.TOTEM_OF_UNDYING)))
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.EMERALD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.BREEZE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BREEZE_ROD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(1.0F, 2.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.FOX, LootTable.lootTable());
 | |
| 		this.add(EntityType.FROG, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.GHAST,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GHAST_TEAR)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GUNPOWDER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.MUSIC_DISC_TEARS))
 | |
| 						.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 						.when(
 | |
| 							DamageSourceCondition.hasDamageSource(
 | |
| 								DamageSourcePredicate.Builder.damageType()
 | |
| 									.tag(TagPredicate.is(DamageTypeTags.IS_PROJECTILE))
 | |
| 									.direct(EntityPredicate.Builder.entity().of(holderGetter, EntityType.FIREBALL))
 | |
| 							)
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.HAPPY_GHAST, LootTable.lootTable());
 | |
| 		this.add(EntityType.GIANT, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.GLOW_SQUID,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GLOW_INK_SAC)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.GOAT, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.GUARDIAN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PRISMARINE_SHARD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.COD)
 | |
| 								.setWeight(2)
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PRISMARINE_CRYSTALS)
 | |
| 								.setWeight(2)
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(EmptyLootItem.emptyItem())
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(NestedLootTable.lootTableReference(BuiltInLootTables.FISHING_FISH).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.HORSE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.HUSK,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.IRON_INGOT))
 | |
| 						.add(LootItem.lootTableItem(Items.CARROT))
 | |
| 						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.RAVAGER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.SADDLE).apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.ILLUSIONER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.IRON_GOLEM,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Blocks.POPPY).apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))))
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.IRON_INGOT).apply(SetItemCountFunction.setCount(UniformGenerator.between(3.0F, 5.0F))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.LLAMA,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.MAGMA_CUBE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.MAGMA_CREAM)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(-2.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.when(this.killedByFrog(holderGetter).invert())
 | |
| 								.when(
 | |
| 									LootItemEntityPropertyCondition.hasProperties(
 | |
| 										LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.atLeast(2)))
 | |
| 									)
 | |
| 								)
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PEARLESCENT_FROGLIGHT)
 | |
| 								.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 								.when(this.killedByFrogVariant(holderGetter, holderGetter2, FrogVariants.WARM))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.VERDANT_FROGLIGHT)
 | |
| 								.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 								.when(this.killedByFrogVariant(holderGetter, holderGetter2, FrogVariants.COLD))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.OCHRE_FROGLIGHT)
 | |
| 								.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 								.when(this.killedByFrogVariant(holderGetter, holderGetter2, FrogVariants.TEMPERATE))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.MULE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.MOOSHROOM,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BEEF)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.OCELOT, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.PANDA,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Blocks.BAMBOO).apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.PARROT,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.FEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.PHANTOM,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PHANTOM_MEMBRANE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.PIG,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PORKCHOP)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.PILLAGER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.OMINOUS_BOTTLE)
 | |
| 								.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 								.apply(SetOminousBottleAmplifierFunction.setAmplifier(UniformGenerator.between(0.0F, 4.0F)))
 | |
| 						)
 | |
| 						.when(
 | |
| 							LootItemEntityPropertyCondition.hasProperties(
 | |
| 								LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().subPredicate(RaiderPredicate.CAPTAIN_WITHOUT_RAID)
 | |
| 							)
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.PLAYER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.POLAR_BEAR,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.COD)
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.setWeight(3)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SALMON)
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.PUFFERFISH,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.PUFFERFISH).apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))))
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.BONE_MEAL))
 | |
| 						.when(LootItemRandomChanceCondition.randomChance(0.05F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.RABBIT,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.RABBIT_HIDE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.RABBIT)
 | |
| 								.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.RABBIT_FOOT))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.1F, 0.03F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SALMON,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.SALMON).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.BONE_MEAL))
 | |
| 						.when(LootItemRandomChanceCondition.randomChance(0.05F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SHEEP,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.MUTTON)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(createSheepDispatchPool(BuiltInLootTables.SHEEP_BY_DYE))
 | |
| 		);
 | |
| 		LootData.WOOL_ITEM_BY_DYE
 | |
| 			.forEach(
 | |
| 				(dyeColor, itemLike) -> this.add(
 | |
| 					EntityType.SHEEP,
 | |
| 					(ResourceKey<LootTable>)BuiltInLootTables.SHEEP_BY_DYE.get(dyeColor),
 | |
| 					LootTable.lootTable().withPool(LootPool.lootPool().add(LootItem.lootTableItem(itemLike)))
 | |
| 				)
 | |
| 			);
 | |
| 		this.add(
 | |
| 			EntityType.SHULKER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.SHULKER_SHELL))
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.5F, 0.0625F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.SILVERFISH, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.SKELETON,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ARROW)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SKELETON_HORSE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SLIME,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SLIME_BALL)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.when(this.killedByFrog(holderGetter).invert())
 | |
| 						)
 | |
| 						.add(LootItem.lootTableItem(Items.SLIME_BALL).apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))).when(this.killedByFrog(holderGetter)))
 | |
| 						.when(
 | |
| 							LootItemEntityPropertyCondition.hasProperties(
 | |
| 								LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1)))
 | |
| 							)
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.SNIFFER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.SNOW_GOLEM,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.SNOWBALL).apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 15.0F))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SPIDER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.STRING)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SPIDER_EYE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(-1.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.SQUID,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.INK_SAC)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.STRAY,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ARROW)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.TIPPED_ARROW)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)).setLimit(1))
 | |
| 								.apply(SetPotionFunction.setPotion(Potions.SLOWNESS))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.STRIDER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.STRING)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 5.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.TADPOLE, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.TRADER_LLAMA,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.TROPICAL_FISH,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.TROPICAL_FISH).apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))))
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.BONE_MEAL))
 | |
| 						.when(LootItemRandomChanceCondition.randomChance(0.05F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.TURTLE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Blocks.SEAGRASS)
 | |
| 								.setWeight(3)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.BOWL))
 | |
| 						.when(DamageSourceCondition.hasDamageSource(DamageSourcePredicate.Builder.damageType().tag(TagPredicate.is(DamageTypeTags.IS_LIGHTNING))))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.VEX, LootTable.lootTable());
 | |
| 		this.add(EntityType.VILLAGER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.WARDEN,
 | |
| 			LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(Items.SCULK_CATALYST)))
 | |
| 		);
 | |
| 		this.add(EntityType.WANDERING_TRADER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.VINDICATOR,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.EMERALD)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.WITCH,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(UniformGenerator.between(1.0F, 3.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GLOWSTONE_DUST)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SUGAR)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.SPIDER_EYE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GLASS_BOTTLE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GUNPOWDER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.STICK)
 | |
| 								.setWeight(2)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.REDSTONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(4.0F, 8.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.WITHER, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.WITHER_SKELETON,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.COAL)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(-1.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.BONE)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Blocks.WITHER_SKELETON_SKULL))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.WOLF, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.ZOGLIN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.CREAKING, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.ZOMBIE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.IRON_INGOT))
 | |
| 						.add(LootItem.lootTableItem(Items.CARROT))
 | |
| 						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.ZOMBIE_HORSE,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.ZOMBIFIED_PIGLIN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.GOLD_NUGGET)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.GOLD_INGOT))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(
 | |
| 			EntityType.HOGLIN,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.PORKCHOP)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F)))
 | |
| 								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.LEATHER)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 		);
 | |
| 		this.add(EntityType.PIGLIN, LootTable.lootTable());
 | |
| 		this.add(EntityType.PIGLIN_BRUTE, LootTable.lootTable());
 | |
| 		this.add(
 | |
| 			EntityType.ZOMBIE_VILLAGER,
 | |
| 			LootTable.lootTable()
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(
 | |
| 							LootItem.lootTableItem(Items.ROTTEN_FLESH)
 | |
| 								.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 						)
 | |
| 				)
 | |
| 				.withPool(
 | |
| 					LootPool.lootPool()
 | |
| 						.setRolls(ConstantValue.exactly(1.0F))
 | |
| 						.add(LootItem.lootTableItem(Items.IRON_INGOT))
 | |
| 						.add(LootItem.lootTableItem(Items.CARROT))
 | |
| 						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 						.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 				)
 | |
| 		);
 | |
| 	}
 | |
| 
 | |
| 	public LootTable.Builder elderGuardianLootTable() {
 | |
| 		return LootTable.lootTable()
 | |
| 			.withPool(
 | |
| 				LootPool.lootPool()
 | |
| 					.setRolls(ConstantValue.exactly(1.0F))
 | |
| 					.add(
 | |
| 						LootItem.lootTableItem(Items.PRISMARINE_SHARD)
 | |
| 							.apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F)))
 | |
| 							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 					)
 | |
| 			)
 | |
| 			.withPool(
 | |
| 				LootPool.lootPool()
 | |
| 					.setRolls(ConstantValue.exactly(1.0F))
 | |
| 					.add(
 | |
| 						LootItem.lootTableItem(Items.COD)
 | |
| 							.setWeight(3)
 | |
| 							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 							.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
 | |
| 					)
 | |
| 					.add(
 | |
| 						LootItem.lootTableItem(Items.PRISMARINE_CRYSTALS)
 | |
| 							.setWeight(2)
 | |
| 							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F)))
 | |
| 					)
 | |
| 					.add(EmptyLootItem.emptyItem())
 | |
| 			)
 | |
| 			.withPool(
 | |
| 				LootPool.lootPool()
 | |
| 					.setRolls(ConstantValue.exactly(1.0F))
 | |
| 					.add(LootItem.lootTableItem(Blocks.WET_SPONGE))
 | |
| 					.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 			)
 | |
| 			.withPool(
 | |
| 				LootPool.lootPool()
 | |
| 					.setRolls(ConstantValue.exactly(1.0F))
 | |
| 					.add(NestedLootTable.lootTableReference(BuiltInLootTables.FISHING_FISH).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
 | |
| 					.when(LootItemKilledByPlayerCondition.killedByPlayer())
 | |
| 					.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F))
 | |
| 			)
 | |
| 			.withPool(
 | |
| 				LootPool.lootPool()
 | |
| 					.setRolls(ConstantValue.exactly(1.0F))
 | |
| 					.add(EmptyLootItem.emptyItem().setWeight(4))
 | |
| 					.add(LootItem.lootTableItem(Items.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE).setWeight(1))
 | |
| 			);
 | |
| 	}
 | |
| }
 |