VanillaEntityLoot .java

net.minecraft.data.loot.packs.VanillaEntityLoot (class, 1331 lines): members: elderGuardianLootTable, generate. imports: LootItemKilledByPlayerCondition.

net.minecraft.data.loot.packsclass1,331 linescommonextends EntityLootSubProvider50.5 KB

API Surface (2)

void generate()
LootTable.Builder elderGuardianLootTable()

Full Source

VanillaEntityLoot.java1331 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.data.loot.packs;
2
3
import net.minecraft.advancements.predicates.DamageSourcePredicate;
4
import net.minecraft.advancements.predicates.MinMaxBounds;
5
import net.minecraft.advancements.predicates.TagPredicate;
6
import net.minecraft.advancements.predicates.entity.CubeMobPredicate;
7
import net.minecraft.advancements.predicates.entity.EntityFlagsPredicate;
8
import net.minecraft.advancements.predicates.entity.EntityPredicate;
9
import net.minecraft.advancements.predicates.entity.EntityTypePredicate;
10
import net.minecraft.advancements.predicates.entity.RaiderPredicate;
11
import net.minecraft.data.loot.EntityLootSubProvider;
12
import net.minecraft.data.loot.LootTableSubProvider;
13
import net.minecraft.tags.DamageTypeTags;
14
import net.minecraft.tags.EntityTypeTags;
15
import net.minecraft.tags.ItemTags;
16
import net.minecraft.world.entity.EntityTypes;
17
import net.minecraft.world.entity.animal.frog.FrogVariants;
18
import net.minecraft.world.flag.FeatureFlags;
19
import net.minecraft.world.item.Items;
20
import net.minecraft.world.item.alchemy.Potions;
21
import net.minecraft.world.level.block.Blocks;
22
import net.minecraft.world.level.block.ColorCollection;
23
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
24
import net.minecraft.world.level.storage.loot.LootContext;
25
import net.minecraft.world.level.storage.loot.LootPool;
26
import net.minecraft.world.level.storage.loot.LootTable;
27
import net.minecraft.world.level.storage.loot.entries.EmptyLootItem;
28
import net.minecraft.world.level.storage.loot.entries.LootItem;
29
import net.minecraft.world.level.storage.loot.entries.NestedLootTable;
30
import net.minecraft.world.level.storage.loot.entries.TagEntry;
31
import net.minecraft.world.level.storage.loot.functions.EnchantedCountIncreaseFunction;
32
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
33
import net.minecraft.world.level.storage.loot.functions.SetOminousBottleAmplifierFunction;
34
import net.minecraft.world.level.storage.loot.functions.SetPotionFunction;
35
import net.minecraft.world.level.storage.loot.functions.SmeltItemFunction;
36
import net.minecraft.world.level.storage.loot.predicates.DamageSourceCondition;
37
import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition;
38
import net.minecraft.world.level.storage.loot.predicates.LootItemKilledByPlayerCondition;
39
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
40
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceWithEnchantedBonusCondition;
41
import net.minecraft.world.level.storage.loot.providers.number.floats.ContextFloatProviders;
42
import net.minecraft.world.level.storage.loot.providers.number.ints.ContextIntProviders;
43
44
public class VanillaEntityLoot extends EntityLootSubProvider {
45
	public VanillaEntityLoot(final LootTableSubProvider.Context output) {
46
		super(FeatureFlags.REGISTRY.allFlags(), output);
47
	}
48
49
	@Override
50
	public void generate() {
51
		this.add(EntityTypes.ALLAY, LootTable.lootTable());
52
		this.add(EntityTypes.ARMADILLO, LootTable.lootTable());
53
		this.add(EntityTypes.ARMOR_STAND, LootTable.lootTable());
54
		this.add(EntityTypes.AXOLOTL, LootTable.lootTable());
55
		this.add(EntityTypes.BAT, LootTable.lootTable());
56
		this.add(EntityTypes.BEE, LootTable.lootTable());
57
		this.add(
58
			EntityTypes.BLAZE,
59
			LootTable.lootTable()
60
				.withPool(
61
					LootPool.lootPool()
62
						.setRolls(ContextIntProviders.exactly(1))
63
						.add(
64
							LootItem.lootTableItem(Items.BLAZE_ROD)
65
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
66
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
67
						)
68
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
69
				)
70
		);
71
		this.add(
72
			EntityTypes.BOGGED,
73
			LootTable.lootTable()
74
				.withPool(
75
					LootPool.lootPool()
76
						.setRolls(ContextIntProviders.exactly(1))
77
						.add(
78
							LootItem.lootTableItem(Items.ARROW)
79
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
80
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
81
						)
82
				)
83
				.withPool(
84
					LootPool.lootPool()
85
						.setRolls(ContextIntProviders.exactly(1))
86
						.add(
87
							LootItem.lootTableItem(Items.BONE)
88
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
89
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
90
						)
91
				)
92
				.withPool(
93
					LootPool.lootPool()
94
						.setRolls(ContextIntProviders.exactly(1))
95
						.add(
96
							LootItem.lootTableItem(Items.TIPPED_ARROW)
97
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
98
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)).setLimit(1))
99
								.apply(SetPotionFunction.setPotion(Potions.POISON))
100
						)
101
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
102
				)
103
		);
104
		this.add(
105
			EntityTypes.CAT,
106
			LootTable.lootTable()
107
				.withPool(
108
					LootPool.lootPool()
109
						.setRolls(ContextIntProviders.exactly(1))
110
						.add(LootItem.lootTableItem(Items.STRING).apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2))))
111
				)
112
		);
113
		this.add(EntityTypes.CAMEL, LootTable.lootTable());
114
		this.add(
115
			EntityTypes.CAMEL_HUSK,
116
			LootTable.lootTable()
117
				.withPool(
118
					LootPool.lootPool()
119
						.setRolls(ContextIntProviders.exactly(1))
120
						.add(
121
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
122
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(2, 3)))
123
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
124
						)
125
				)
126
		);
127
		this.add(
128
			EntityTypes.CAVE_SPIDER,
129
			LootTable.lootTable()
130
				.withPool(
131
					LootPool.lootPool()
132
						.setRolls(ContextIntProviders.exactly(1))
133
						.add(
134
							LootItem.lootTableItem(Items.STRING)
135
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
136
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
137
						)
138
				)
139
				.withPool(
140
					LootPool.lootPool()
141
						.setRolls(ContextIntProviders.exactly(1))
142
						.add(
143
							LootItem.lootTableItem(Items.SPIDER_EYE)
144
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(-1, 1)))
145
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
146
						)
147
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
148
				)
149
		);
150
		this.add(
151
			EntityTypes.CHICKEN,
152
			LootTable.lootTable()
153
				.withPool(
154
					LootPool.lootPool()
155
						.setRolls(ContextIntProviders.exactly(1))
156
						.add(
157
							LootItem.lootTableItem(Items.FEATHER)
158
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
159
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
160
						)
161
				)
162
				.withPool(
163
					LootPool.lootPool()
164
						.setRolls(ContextIntProviders.exactly(1))
165
						.add(
166
							LootItem.lootTableItem(Items.CHICKEN)
167
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
168
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
169
						)
170
				)
171
		);
172
		this.add(
173
			EntityTypes.COD,
174
			LootTable.lootTable()
175
				.withPool(
176
					LootPool.lootPool()
177
						.setRolls(ContextIntProviders.exactly(1))
178
						.add(LootItem.lootTableItem(Items.COD).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
179
				)
180
				.withPool(
181
					LootPool.lootPool()
182
						.setRolls(ContextIntProviders.exactly(1))
183
						.add(LootItem.lootTableItem(Items.BONE_MEAL))
184
						.when(LootItemRandomChanceCondition.randomChance(0.05F))
185
				)
186
		);
187
		this.add(
188
			EntityTypes.COPPER_GOLEM,
189
			LootTable.lootTable()
190
				.withPool(
191
					LootPool.lootPool()
192
						.setRolls(ContextIntProviders.exactly(1))
193
						.add(
194
							LootItem.lootTableItem(Items.COPPER_INGOT)
195
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
196
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
197
						)
198
				)
199
		);
200
		this.add(
201
			EntityTypes.COW,
202
			LootTable.lootTable()
203
				.withPool(
204
					LootPool.lootPool()
205
						.setRolls(ContextIntProviders.exactly(1))
206
						.add(
207
							LootItem.lootTableItem(Items.LEATHER)
208
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
209
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
210
						)
211
				)
212
				.withPool(
213
					LootPool.lootPool()
214
						.setRolls(ContextIntProviders.exactly(1))
215
						.add(
216
							LootItem.lootTableItem(Items.BEEF)
217
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
218
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
219
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
220
						)
221
				)
222
		);
223
		this.add(
224
			EntityTypes.CREEPER,
225
			LootTable.lootTable()
226
				.withPool(
227
					LootPool.lootPool()
228
						.setRolls(ContextIntProviders.exactly(1))
229
						.add(
230
							LootItem.lootTableItem(Items.GUNPOWDER)
231
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
232
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
233
						)
234
				)
235
				.withPool(
236
					LootPool.lootPool()
237
						.add(TagEntry.expandTag(this.items.getOrThrow(ItemTags.CREEPER_DROP_MUSIC_DISCS)))
238
						.when(
239
							LootItemEntityPropertyCondition.hasProperties(
240
								LootContext.EntityTarget.ATTACKER, EntityPredicate.Builder.entity().of(this.entityTypes, EntityTypeTags.SKELETONS)
241
							)
242
						)
243
				)
244
		);
245
		this.add(
246
			EntityTypes.DOLPHIN,
247
			LootTable.lootTable()
248
				.withPool(
249
					LootPool.lootPool()
250
						.setRolls(ContextIntProviders.exactly(1))
251
						.add(
252
							LootItem.lootTableItem(Items.COD)
253
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
254
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
255
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
256
						)
257
				)
258
		);
259
		this.add(
260
			EntityTypes.DONKEY,
261
			LootTable.lootTable()
262
				.withPool(
263
					LootPool.lootPool()
264
						.setRolls(ContextIntProviders.exactly(1))
265
						.add(
266
							LootItem.lootTableItem(Items.LEATHER)
267
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
268
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
269
						)
270
				)
271
		);
272
		this.add(
273
			EntityTypes.DROWNED,
274
			LootTable.lootTable()
275
				.withPool(
276
					LootPool.lootPool()
277
						.setRolls(ContextIntProviders.exactly(1))
278
						.add(
279
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
280
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
281
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
282
						)
283
				)
284
				.withPool(
285
					LootPool.lootPool()
286
						.setRolls(ContextIntProviders.exactly(1))
287
						.add(LootItem.lootTableItem(Items.COPPER_INGOT))
288
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
289
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.11F, 0.02F))
290
				)
291
		);
292
		this.add(EntityTypes.ELDER_GUARDIAN, this.elderGuardianLootTable());
293
		this.add(EntityTypes.ENDER_DRAGON, LootTable.lootTable());
294
		this.add(
295
			EntityTypes.ENDERMAN,
296
			LootTable.lootTable()
297
				.withPool(
298
					LootPool.lootPool()
299
						.setRolls(ContextIntProviders.exactly(1))
300
						.add(
301
							LootItem.lootTableItem(Items.ENDER_PEARL)
302
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
303
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
304
						)
305
				)
306
		);
307
		this.add(EntityTypes.ENDERMITE, LootTable.lootTable());
308
		this.add(
309
			EntityTypes.EVOKER,
310
			LootTable.lootTable()
311
				.withPool(LootPool.lootPool().setRolls(ContextIntProviders.exactly(1)).add(LootItem.lootTableItem(Items.TOTEM_OF_UNDYING)))
312
				.withPool(
313
					LootPool.lootPool()
314
						.setRolls(ContextIntProviders.exactly(1))
315
						.add(
316
							LootItem.lootTableItem(Items.EMERALD)
317
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
318
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
319
						)
320
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
321
				)
322
		);
323
		this.add(
324
			EntityTypes.BREEZE,
325
			LootTable.lootTable()
326
				.withPool(
327
					LootPool.lootPool()
328
						.setRolls(ContextIntProviders.exactly(1))
329
						.add(
330
							LootItem.lootTableItem(Items.BREEZE_ROD)
331
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 2)))
332
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(1.0F, 2.0F)))
333
						)
334
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
335
				)
336
		);
337
		this.add(EntityTypes.FOX, LootTable.lootTable());
338
		this.add(EntityTypes.FROG, LootTable.lootTable());
339
		this.add(
340
			EntityTypes.GHAST,
341
			LootTable.lootTable()
342
				.withPool(
343
					LootPool.lootPool()
344
						.setRolls(ContextIntProviders.exactly(1))
345
						.add(
346
							LootItem.lootTableItem(Items.GHAST_TEAR)
347
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
348
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
349
						)
350
				)
351
				.withPool(
352
					LootPool.lootPool()
353
						.setRolls(ContextIntProviders.exactly(1))
354
						.add(
355
							LootItem.lootTableItem(Items.GUNPOWDER)
356
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
357
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
358
						)
359
				)
360
				.withPool(
361
					LootPool.lootPool()
362
						.setRolls(ContextIntProviders.exactly(1))
363
						.add(LootItem.lootTableItem(Items.MUSIC_DISC_TEARS))
364
						.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
365
						.when(DamageSourceCondition.hasDamageSource(this.projectileDamage().direct(EntityPredicate.Builder.entity().of(this.entityTypes, EntityTypes.FIREBALL))))
366
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
367
				)
368
		);
369
		this.add(EntityTypes.HAPPY_GHAST, LootTable.lootTable());
370
		this.add(EntityTypes.GIANT, LootTable.lootTable());
371
		this.add(
372
			EntityTypes.GLOW_SQUID,
373
			LootTable.lootTable()
374
				.withPool(
375
					LootPool.lootPool()
376
						.setRolls(ContextIntProviders.exactly(1))
377
						.add(
378
							LootItem.lootTableItem(Items.GLOW_INK_SAC)
379
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
380
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
381
						)
382
				)
383
		);
384
		this.add(EntityTypes.GOAT, LootTable.lootTable());
385
		this.add(
386
			EntityTypes.GUARDIAN,
387
			LootTable.lootTable()
388
				.withPool(
389
					LootPool.lootPool()
390
						.setRolls(ContextIntProviders.exactly(1))
391
						.add(
392
							LootItem.lootTableItem(Items.PRISMARINE_SHARD)
393
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
394
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
395
						)
396
				)
397
				.withPool(
398
					LootPool.lootPool()
399
						.setRolls(ContextIntProviders.exactly(1))
400
						.add(
401
							LootItem.lootTableItem(Items.COD)
402
								.setWeight(2)
403
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
404
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
405
						)
406
						.add(
407
							LootItem.lootTableItem(Items.PRISMARINE_CRYSTALS)
408
								.setWeight(2)
409
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
410
						)
411
						.add(EmptyLootItem.emptyItem())
412
				)
413
				.withPool(
414
					LootPool.lootPool()
415
						.setRolls(ContextIntProviders.exactly(1))
416
						.add(
417
							NestedLootTable.lootTableReference(this.lootTables.getOrThrow(BuiltInLootTables.FISHING_FISH))
418
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
419
						)
420
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
421
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
422
				)
423
		);
424
		this.add(
425
			EntityTypes.HORSE,
426
			LootTable.lootTable()
427
				.withPool(
428
					LootPool.lootPool()
429
						.setRolls(ContextIntProviders.exactly(1))
430
						.add(
431
							LootItem.lootTableItem(Items.LEATHER)
432
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
433
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
434
						)
435
				)
436
		);
437
		this.add(
438
			EntityTypes.HUSK,
439
			LootTable.lootTable()
440
				.withPool(
441
					LootPool.lootPool()
442
						.setRolls(ContextIntProviders.exactly(1))
443
						.add(
444
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
445
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
446
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
447
						)
448
				)
449
				.withPool(
450
					LootPool.lootPool()
451
						.setRolls(ContextIntProviders.exactly(1))
452
						.add(
453
							LootItem.lootTableItem(Items.RABBIT_FOOT)
454
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
455
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
456
								.when(
457
									LootItemEntityPropertyCondition.hasProperties(
458
										LootContext.EntityTarget.THIS,
459
										EntityPredicate.Builder.entity()
460
											.vehicle(EntityPredicate.Builder.entity().entityType(EntityTypePredicate.of(this.entityTypes, EntityTypes.CAMEL_HUSK)))
461
											.build()
462
									)
463
								)
464
						)
465
				)
466
				.withPool(
467
					LootPool.lootPool()
468
						.setRolls(ContextIntProviders.exactly(1))
469
						.add(LootItem.lootTableItem(Items.IRON_INGOT))
470
						.add(LootItem.lootTableItem(Items.CARROT))
471
						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
472
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
473
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
474
				)
475
		);
476
		this.add(
477
			EntityTypes.RAVAGER,
478
			LootTable.lootTable()
479
				.withPool(
480
					LootPool.lootPool()
481
						.setRolls(ContextIntProviders.exactly(1))
482
						.add(LootItem.lootTableItem(Items.SADDLE).apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1))))
483
				)
484
		);
485
		this.add(EntityTypes.ILLUSIONER, LootTable.lootTable());
486
		this.add(
487
			EntityTypes.IRON_GOLEM,
488
			LootTable.lootTable()
489
				.withPool(
490
					LootPool.lootPool()
491
						.setRolls(ContextIntProviders.exactly(1))
492
						.add(LootItem.lootTableItem(Blocks.POPPY).apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2))))
493
				)
494
				.withPool(
495
					LootPool.lootPool()
496
						.setRolls(ContextIntProviders.exactly(1))
497
						.add(LootItem.lootTableItem(Items.IRON_INGOT).apply(SetItemCountFunction.setCount(ContextIntProviders.between(3, 5))))
498
				)
499
		);
500
		this.add(
501
			EntityTypes.LLAMA,
502
			LootTable.lootTable()
503
				.withPool(
504
					LootPool.lootPool()
505
						.setRolls(ContextIntProviders.exactly(1))
506
						.add(
507
							LootItem.lootTableItem(Items.LEATHER)
508
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
509
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
510
						)
511
				)
512
		);
513
		this.add(
514
			EntityTypes.MAGMA_CUBE,
515
			LootTable.lootTable()
516
				.withPool(
517
					LootPool.lootPool()
518
						.setRolls(ContextIntProviders.exactly(1))
519
						.add(
520
							LootItem.lootTableItem(Items.MAGMA_CREAM)
521
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(-2, 1)))
522
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
523
								.when(this.killedByFrog().invert())
524
								.when(
525
									LootItemEntityPropertyCondition.hasProperties(
526
										LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().cubeMob(CubeMobPredicate.sized(MinMaxBounds.Ints.atLeast(2)))
527
									)
528
								)
529
						)
530
						.add(
531
							LootItem.lootTableItem(Items.PEARLESCENT_FROGLIGHT)
532
								.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
533
								.when(this.killedByFrogVariant(FrogVariants.WARM))
534
						)
535
						.add(
536
							LootItem.lootTableItem(Items.VERDANT_FROGLIGHT)
537
								.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
538
								.when(this.killedByFrogVariant(FrogVariants.COLD))
539
						)
540
						.add(
541
							LootItem.lootTableItem(Items.OCHRE_FROGLIGHT)
542
								.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
543
								.when(this.killedByFrogVariant(FrogVariants.TEMPERATE))
544
						)
545
				)
546
		);
547
		this.add(EntityTypes.SULFUR_CUBE, LootTable.lootTable());
548
		this.add(EntityTypes.MANNEQUIN, LootTable.lootTable());
549
		this.add(
550
			EntityTypes.MULE,
551
			LootTable.lootTable()
552
				.withPool(
553
					LootPool.lootPool()
554
						.setRolls(ContextIntProviders.exactly(1))
555
						.add(
556
							LootItem.lootTableItem(Items.LEATHER)
557
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
558
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
559
						)
560
				)
561
		);
562
		this.add(
563
			EntityTypes.MOOSHROOM,
564
			LootTable.lootTable()
565
				.withPool(
566
					LootPool.lootPool()
567
						.setRolls(ContextIntProviders.exactly(1))
568
						.add(
569
							LootItem.lootTableItem(Items.LEATHER)
570
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
571
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
572
						)
573
				)
574
				.withPool(
575
					LootPool.lootPool()
576
						.setRolls(ContextIntProviders.exactly(1))
577
						.add(
578
							LootItem.lootTableItem(Items.BEEF)
579
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
580
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
581
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
582
						)
583
				)
584
		);
585
		this.add(
586
			EntityTypes.NAUTILUS,
587
			LootTable.lootTable()
588
				.withPool(
589
					LootPool.lootPool()
590
						.setRolls(ContextIntProviders.exactly(1))
591
						.add(LootItem.lootTableItem(Items.NAUTILUS_SHELL))
592
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
593
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.05F, 0.01F))
594
				)
595
		);
596
		this.add(EntityTypes.OCELOT, LootTable.lootTable());
597
		this.add(
598
			EntityTypes.PANDA,
599
			LootTable.lootTable()
600
				.withPool(
601
					LootPool.lootPool()
602
						.setRolls(ContextIntProviders.exactly(1))
603
						.add(LootItem.lootTableItem(Blocks.BAMBOO).apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1))))
604
				)
605
		);
606
		this.add(
607
			EntityTypes.PARROT,
608
			LootTable.lootTable()
609
				.withPool(
610
					LootPool.lootPool()
611
						.setRolls(ContextIntProviders.exactly(1))
612
						.add(
613
							LootItem.lootTableItem(Items.FEATHER)
614
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 2)))
615
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
616
						)
617
				)
618
		);
619
		this.add(
620
			EntityTypes.PHANTOM,
621
			LootTable.lootTable()
622
				.withPool(
623
					LootPool.lootPool()
624
						.setRolls(ContextIntProviders.exactly(1))
625
						.add(
626
							LootItem.lootTableItem(Items.PHANTOM_MEMBRANE)
627
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
628
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
629
						)
630
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
631
				)
632
		);
633
		this.add(
634
			EntityTypes.PIG,
635
			LootTable.lootTable()
636
				.withPool(
637
					LootPool.lootPool()
638
						.setRolls(ContextIntProviders.exactly(1))
639
						.add(
640
							LootItem.lootTableItem(Items.PORKCHOP)
641
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
642
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
643
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
644
						)
645
				)
646
		);
647
		this.add(
648
			EntityTypes.PILLAGER,
649
			LootTable.lootTable()
650
				.withPool(
651
					LootPool.lootPool()
652
						.setRolls(ContextIntProviders.exactly(1))
653
						.add(
654
							LootItem.lootTableItem(Items.OMINOUS_BOTTLE)
655
								.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
656
								.apply(SetOminousBottleAmplifierFunction.setAmplifier(ContextIntProviders.between(0, 4)))
657
						)
658
						.when(
659
							LootItemEntityPropertyCondition.hasProperties(
660
								LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().raider(RaiderPredicate.CAPTAIN_WITHOUT_RAID)
661
							)
662
						)
663
				)
664
		);
665
		this.add(EntityTypes.PLAYER, LootTable.lootTable());
666
		this.add(
667
			EntityTypes.POLAR_BEAR,
668
			LootTable.lootTable()
669
				.withPool(
670
					LootPool.lootPool()
671
						.setRolls(ContextIntProviders.exactly(1))
672
						.add(
673
							LootItem.lootTableItem(Items.COD)
674
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
675
								.setWeight(3)
676
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
677
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
678
						)
679
						.add(
680
							LootItem.lootTableItem(Items.SALMON)
681
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
682
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
683
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
684
						)
685
				)
686
		);
687
		this.add(
688
			EntityTypes.PUFFERFISH,
689
			LootTable.lootTable()
690
				.withPool(
691
					LootPool.lootPool()
692
						.setRolls(ContextIntProviders.exactly(1))
693
						.add(LootItem.lootTableItem(Items.PUFFERFISH).apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1))))
694
				)
695
				.withPool(
696
					LootPool.lootPool()
697
						.setRolls(ContextIntProviders.exactly(1))
698
						.add(LootItem.lootTableItem(Items.BONE_MEAL))
699
						.when(LootItemRandomChanceCondition.randomChance(0.05F))
700
				)
701
		);
702
		this.add(
703
			EntityTypes.RABBIT,
704
			LootTable.lootTable()
705
				.withPool(
706
					LootPool.lootPool()
707
						.setRolls(ContextIntProviders.exactly(1))
708
						.add(
709
							LootItem.lootTableItem(Items.RABBIT_HIDE)
710
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
711
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
712
						)
713
				)
714
				.withPool(
715
					LootPool.lootPool()
716
						.setRolls(ContextIntProviders.exactly(1))
717
						.add(
718
							LootItem.lootTableItem(Items.RABBIT)
719
								.apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1)))
720
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
721
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
722
						)
723
				)
724
				.withPool(
725
					LootPool.lootPool()
726
						.setRolls(ContextIntProviders.exactly(1))
727
						.add(LootItem.lootTableItem(Items.RABBIT_FOOT))
728
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
729
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.1F, 0.03F))
730
				)
731
		);
732
		this.add(
733
			EntityTypes.SALMON,
734
			LootTable.lootTable()
735
				.withPool(
736
					LootPool.lootPool()
737
						.setRolls(ContextIntProviders.exactly(1))
738
						.add(LootItem.lootTableItem(Items.SALMON).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
739
				)
740
				.withPool(
741
					LootPool.lootPool()
742
						.setRolls(ContextIntProviders.exactly(1))
743
						.add(LootItem.lootTableItem(Items.BONE_MEAL))
744
						.when(LootItemRandomChanceCondition.randomChance(0.05F))
745
				)
746
		);
747
		this.add(
748
			EntityTypes.SHEEP,
749
			LootTable.lootTable()
750
				.withPool(
751
					LootPool.lootPool()
752
						.setRolls(ContextIntProviders.exactly(1))
753
						.add(
754
							LootItem.lootTableItem(Items.MUTTON)
755
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 2)))
756
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
757
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
758
						)
759
				)
760
				.withPool(createSheepDispatchPool(BuiltInLootTables.SHEEP.map(this.lootTables::getOrThrow)))
761
		);
762
		ColorCollection.zipApply(
763
			BuiltInLootTables.SHEEP,
764
			Blocks.WOOL,
765
			(sheep, wool) -> this.add(EntityTypes.SHEEP, sheep, LootTable.lootTable().withPool(LootPool.lootPool().add(LootItem.lootTableItem(wool))))
766
		);
767
		this.add(
768
			EntityTypes.SHULKER,
769
			LootTable.lootTable()
770
				.withPool(
771
					LootPool.lootPool()
772
						.setRolls(ContextIntProviders.exactly(1))
773
						.add(LootItem.lootTableItem(Items.SHULKER_SHELL))
774
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.5F, 0.0625F))
775
				)
776
		);
777
		this.add(EntityTypes.SILVERFISH, LootTable.lootTable());
778
		this.add(
779
			EntityTypes.SKELETON,
780
			LootTable.lootTable()
781
				.withPool(
782
					LootPool.lootPool()
783
						.setRolls(ContextIntProviders.exactly(1))
784
						.add(
785
							LootItem.lootTableItem(Items.ARROW)
786
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
787
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
788
						)
789
				)
790
				.withPool(
791
					LootPool.lootPool()
792
						.setRolls(ContextIntProviders.exactly(1))
793
						.add(
794
							LootItem.lootTableItem(Items.BONE)
795
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
796
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
797
						)
798
				)
799
		);
800
		this.add(
801
			EntityTypes.SKELETON_HORSE,
802
			LootTable.lootTable()
803
				.withPool(
804
					LootPool.lootPool()
805
						.setRolls(ContextIntProviders.exactly(1))
806
						.add(
807
							LootItem.lootTableItem(Items.BONE)
808
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
809
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
810
						)
811
				)
812
		);
813
		this.add(
814
			EntityTypes.SLIME,
815
			LootTable.lootTable()
816
				.withPool(
817
					LootPool.lootPool()
818
						.setRolls(ContextIntProviders.exactly(1))
819
						.add(
820
							LootItem.lootTableItem(Items.SLIME_BALL)
821
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
822
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
823
								.when(this.killedByFrog().invert())
824
						)
825
						.add(LootItem.lootTableItem(Items.SLIME_BALL).apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1))).when(this.killedByFrog()))
826
						.when(
827
							LootItemEntityPropertyCondition.hasProperties(
828
								LootContext.EntityTarget.THIS, EntityPredicate.Builder.entity().cubeMob(CubeMobPredicate.sized(MinMaxBounds.Ints.exactly(1)))
829
							)
830
						)
831
				)
832
		);
833
		this.add(EntityTypes.SNIFFER, LootTable.lootTable());
834
		this.add(
835
			EntityTypes.SNOW_GOLEM,
836
			LootTable.lootTable()
837
				.withPool(
838
					LootPool.lootPool()
839
						.setRolls(ContextIntProviders.exactly(1))
840
						.add(LootItem.lootTableItem(Items.SNOWBALL).apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 15))))
841
				)
842
		);
843
		this.add(
844
			EntityTypes.SPIDER,
845
			LootTable.lootTable()
846
				.withPool(
847
					LootPool.lootPool()
848
						.setRolls(ContextIntProviders.exactly(1))
849
						.add(
850
							LootItem.lootTableItem(Items.STRING)
851
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
852
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
853
						)
854
				)
855
				.withPool(
856
					LootPool.lootPool()
857
						.setRolls(ContextIntProviders.exactly(1))
858
						.add(
859
							LootItem.lootTableItem(Items.SPIDER_EYE)
860
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(-1, 1)))
861
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
862
						)
863
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
864
				)
865
		);
866
		this.add(
867
			EntityTypes.SQUID,
868
			LootTable.lootTable()
869
				.withPool(
870
					LootPool.lootPool()
871
						.setRolls(ContextIntProviders.exactly(1))
872
						.add(
873
							LootItem.lootTableItem(Items.INK_SAC)
874
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
875
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
876
						)
877
				)
878
		);
879
		this.add(
880
			EntityTypes.STRAY,
881
			LootTable.lootTable()
882
				.withPool(
883
					LootPool.lootPool()
884
						.setRolls(ContextIntProviders.exactly(1))
885
						.add(
886
							LootItem.lootTableItem(Items.ARROW)
887
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
888
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
889
						)
890
				)
891
				.withPool(
892
					LootPool.lootPool()
893
						.setRolls(ContextIntProviders.exactly(1))
894
						.add(
895
							LootItem.lootTableItem(Items.BONE)
896
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
897
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
898
						)
899
				)
900
				.withPool(
901
					LootPool.lootPool()
902
						.setRolls(ContextIntProviders.exactly(1))
903
						.add(
904
							LootItem.lootTableItem(Items.TIPPED_ARROW)
905
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
906
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)).setLimit(1))
907
								.apply(SetPotionFunction.setPotion(Potions.SLOWNESS))
908
						)
909
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
910
				)
911
		);
912
		this.add(
913
			EntityTypes.PARCHED,
914
			LootTable.lootTable()
915
				.withPool(
916
					LootPool.lootPool()
917
						.setRolls(ContextIntProviders.exactly(1))
918
						.add(
919
							LootItem.lootTableItem(Items.ARROW)
920
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
921
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
922
						)
923
				)
924
				.withPool(
925
					LootPool.lootPool()
926
						.setRolls(ContextIntProviders.exactly(1))
927
						.add(
928
							LootItem.lootTableItem(Items.BONE)
929
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
930
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
931
						)
932
				)
933
				.withPool(
934
					LootPool.lootPool()
935
						.setRolls(ContextIntProviders.exactly(1))
936
						.add(
937
							LootItem.lootTableItem(Items.TIPPED_ARROW)
938
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
939
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)).setLimit(1))
940
								.apply(SetPotionFunction.setPotion(Potions.WEAKNESS))
941
						)
942
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
943
				)
944
		);
945
		this.add(
946
			EntityTypes.STRIDER,
947
			LootTable.lootTable()
948
				.withPool(
949
					LootPool.lootPool()
950
						.setRolls(ContextIntProviders.exactly(1))
951
						.add(
952
							LootItem.lootTableItem(Items.STRING)
953
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(2, 5)))
954
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
955
						)
956
				)
957
		);
958
		this.add(EntityTypes.TADPOLE, LootTable.lootTable());
959
		this.add(
960
			EntityTypes.TRADER_LLAMA,
961
			LootTable.lootTable()
962
				.withPool(
963
					LootPool.lootPool()
964
						.setRolls(ContextIntProviders.exactly(1))
965
						.add(
966
							LootItem.lootTableItem(Items.LEATHER)
967
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
968
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
969
						)
970
				)
971
		);
972
		this.add(
973
			EntityTypes.TROPICAL_FISH,
974
			LootTable.lootTable()
975
				.withPool(
976
					LootPool.lootPool()
977
						.setRolls(ContextIntProviders.exactly(1))
978
						.add(LootItem.lootTableItem(Items.TROPICAL_FISH).apply(SetItemCountFunction.setCount(ContextIntProviders.exactly(1))))
979
				)
980
				.withPool(
981
					LootPool.lootPool()
982
						.setRolls(ContextIntProviders.exactly(1))
983
						.add(LootItem.lootTableItem(Items.BONE_MEAL))
984
						.when(LootItemRandomChanceCondition.randomChance(0.05F))
985
				)
986
		);
987
		this.add(
988
			EntityTypes.TURTLE,
989
			LootTable.lootTable()
990
				.withPool(
991
					LootPool.lootPool()
992
						.setRolls(ContextIntProviders.exactly(1))
993
						.add(
994
							LootItem.lootTableItem(Blocks.SEAGRASS)
995
								.setWeight(3)
996
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
997
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
998
						)
999
				)
1000
				.withPool(
1001
					LootPool.lootPool()
1002
						.setRolls(ContextIntProviders.exactly(1))
1003
						.add(LootItem.lootTableItem(Items.BOWL))
1004
						.when(
1005
							DamageSourceCondition.hasDamageSource(DamageSourcePredicate.Builder.damageType().tag(TagPredicate.is(this.damageTypes, DamageTypeTags.IS_LIGHTNING)))
1006
						)
1007
				)
1008
		);
1009
		this.add(EntityTypes.VEX, LootTable.lootTable());
1010
		this.add(EntityTypes.VILLAGER, LootTable.lootTable());
1011
		this.add(
1012
			EntityTypes.WARDEN,
1013
			LootTable.lootTable().withPool(LootPool.lootPool().setRolls(ContextIntProviders.exactly(1)).add(LootItem.lootTableItem(Items.SCULK_CATALYST)))
1014
		);
1015
		this.add(EntityTypes.WANDERING_TRADER, LootTable.lootTable());
1016
		this.add(
1017
			EntityTypes.VINDICATOR,
1018
			LootTable.lootTable()
1019
				.withPool(
1020
					LootPool.lootPool()
1021
						.setRolls(ContextIntProviders.exactly(1))
1022
						.add(
1023
							LootItem.lootTableItem(Items.EMERALD)
1024
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
1025
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1026
						)
1027
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1028
				)
1029
		);
1030
		this.add(
1031
			EntityTypes.WITCH,
1032
			LootTable.lootTable()
1033
				.withPool(
1034
					LootPool.lootPool()
1035
						.setRolls(ContextIntProviders.between(1, 3))
1036
						.add(
1037
							LootItem.lootTableItem(Items.GLOWSTONE_DUST)
1038
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1039
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1040
						)
1041
						.add(
1042
							LootItem.lootTableItem(Items.SUGAR)
1043
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1044
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1045
						)
1046
						.add(
1047
							LootItem.lootTableItem(Items.SPIDER_EYE)
1048
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1049
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1050
						)
1051
						.add(
1052
							LootItem.lootTableItem(Items.GLASS_BOTTLE)
1053
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1054
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1055
						)
1056
						.add(
1057
							LootItem.lootTableItem(Items.GUNPOWDER)
1058
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1059
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1060
						)
1061
						.add(
1062
							LootItem.lootTableItem(Items.STICK)
1063
								.setWeight(2)
1064
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1065
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1066
						)
1067
				)
1068
				.withPool(
1069
					LootPool.lootPool()
1070
						.setRolls(ContextIntProviders.exactly(1))
1071
						.add(
1072
							LootItem.lootTableItem(Items.REDSTONE)
1073
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(4, 8)))
1074
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1075
						)
1076
				)
1077
		);
1078
		this.add(EntityTypes.WITHER, LootTable.lootTable());
1079
		this.add(
1080
			EntityTypes.WITHER_SKELETON,
1081
			LootTable.lootTable()
1082
				.withPool(
1083
					LootPool.lootPool()
1084
						.setRolls(ContextIntProviders.exactly(1))
1085
						.add(
1086
							LootItem.lootTableItem(Items.COAL)
1087
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(-1, 1)))
1088
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1089
						)
1090
				)
1091
				.withPool(
1092
					LootPool.lootPool()
1093
						.setRolls(ContextIntProviders.exactly(1))
1094
						.add(
1095
							LootItem.lootTableItem(Items.BONE)
1096
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1097
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1098
						)
1099
				)
1100
				.withPool(
1101
					LootPool.lootPool()
1102
						.setRolls(ContextIntProviders.exactly(1))
1103
						.add(LootItem.lootTableItem(Blocks.WITHER_SKELETON_SKULL))
1104
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1105
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
1106
				)
1107
		);
1108
		this.add(EntityTypes.WOLF, LootTable.lootTable());
1109
		this.add(
1110
			EntityTypes.ZOGLIN,
1111
			LootTable.lootTable()
1112
				.withPool(
1113
					LootPool.lootPool()
1114
						.setRolls(ContextIntProviders.exactly(1))
1115
						.add(
1116
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1117
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(1, 3)))
1118
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1119
						)
1120
				)
1121
		);
1122
		this.add(EntityTypes.CREAKING, LootTable.lootTable());
1123
		this.add(
1124
			EntityTypes.ZOMBIE,
1125
			LootTable.lootTable()
1126
				.withPool(
1127
					LootPool.lootPool()
1128
						.setRolls(ContextIntProviders.exactly(1))
1129
						.add(
1130
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1131
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1132
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1133
						)
1134
				)
1135
				.withPool(
1136
					LootPool.lootPool()
1137
						.setRolls(ContextIntProviders.exactly(1))
1138
						.add(
1139
							LootItem.lootTableItem(Items.RED_MUSHROOM)
1140
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
1141
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1142
								.when(
1143
									LootItemEntityPropertyCondition.hasProperties(
1144
										LootContext.EntityTarget.THIS,
1145
										EntityPredicate.Builder.entity()
1146
											.vehicle(EntityPredicate.Builder.entity().entityType(EntityTypePredicate.of(this.entityTypes, EntityTypes.ZOMBIE_HORSE)))
1147
											.build()
1148
									)
1149
								)
1150
						)
1151
				)
1152
				.withPool(
1153
					LootPool.lootPool()
1154
						.setRolls(ContextIntProviders.exactly(1))
1155
						.add(LootItem.lootTableItem(Items.IRON_INGOT))
1156
						.add(LootItem.lootTableItem(Items.CARROT))
1157
						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
1158
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1159
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
1160
				)
1161
				.withPool(
1162
					LootPool.lootPool()
1163
						.add(LootItem.lootTableItem(Items.MUSIC_DISC_LAVA_CHICKEN))
1164
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1165
						.when(
1166
							LootItemEntityPropertyCondition.hasProperties(
1167
								LootContext.EntityTarget.THIS,
1168
								EntityPredicate.Builder.entity()
1169
									.flags(EntityFlagsPredicate.Builder.flags().setIsBaby(true))
1170
									.vehicle(EntityPredicate.Builder.entity().of(this.entityTypes, EntityTypes.CHICKEN))
1171
							)
1172
						)
1173
				)
1174
		);
1175
		this.add(
1176
			EntityTypes.ZOMBIE_HORSE,
1177
			LootTable.lootTable()
1178
				.withPool(
1179
					LootPool.lootPool()
1180
						.setRolls(ContextIntProviders.exactly(1))
1181
						.add(
1182
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1183
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(2, 3)))
1184
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1185
						)
1186
				)
1187
		);
1188
		this.add(
1189
			EntityTypes.ZOMBIE_NAUTILUS,
1190
			LootTable.lootTable()
1191
				.withPool(
1192
					LootPool.lootPool()
1193
						.setRolls(ContextIntProviders.exactly(1))
1194
						.add(
1195
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1196
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 3)))
1197
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1198
						)
1199
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1200
				)
1201
		);
1202
		this.add(
1203
			EntityTypes.ZOMBIFIED_PIGLIN,
1204
			LootTable.lootTable()
1205
				.withPool(
1206
					LootPool.lootPool()
1207
						.setRolls(ContextIntProviders.exactly(1))
1208
						.add(
1209
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1210
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
1211
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1212
						)
1213
				)
1214
				.withPool(
1215
					LootPool.lootPool()
1216
						.setRolls(ContextIntProviders.exactly(1))
1217
						.add(
1218
							LootItem.lootTableItem(Items.GOLD_NUGGET)
1219
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
1220
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1221
						)
1222
				)
1223
				.withPool(
1224
					LootPool.lootPool()
1225
						.setRolls(ContextIntProviders.exactly(1))
1226
						.add(LootItem.lootTableItem(Items.GOLD_INGOT))
1227
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1228
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
1229
				)
1230
		);
1231
		this.add(
1232
			EntityTypes.HOGLIN,
1233
			LootTable.lootTable()
1234
				.withPool(
1235
					LootPool.lootPool()
1236
						.setRolls(ContextIntProviders.exactly(1))
1237
						.add(
1238
							LootItem.lootTableItem(Items.PORKCHOP)
1239
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(2, 4)))
1240
								.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
1241
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1242
						)
1243
				)
1244
				.withPool(
1245
					LootPool.lootPool()
1246
						.setRolls(ContextIntProviders.exactly(1))
1247
						.add(
1248
							LootItem.lootTableItem(Items.LEATHER)
1249
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 1)))
1250
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1251
						)
1252
				)
1253
		);
1254
		this.add(EntityTypes.PIGLIN, LootTable.lootTable());
1255
		this.add(EntityTypes.PIGLIN_BRUTE, LootTable.lootTable());
1256
		this.add(
1257
			EntityTypes.ZOMBIE_VILLAGER,
1258
			LootTable.lootTable()
1259
				.withPool(
1260
					LootPool.lootPool()
1261
						.setRolls(ContextIntProviders.exactly(1))
1262
						.add(
1263
							LootItem.lootTableItem(Items.ROTTEN_FLESH)
1264
								.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1265
								.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1266
						)
1267
				)
1268
				.withPool(
1269
					LootPool.lootPool()
1270
						.setRolls(ContextIntProviders.exactly(1))
1271
						.add(LootItem.lootTableItem(Items.IRON_INGOT))
1272
						.add(LootItem.lootTableItem(Items.CARROT))
1273
						.add(LootItem.lootTableItem(Items.POTATO).apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())))
1274
						.when(LootItemKilledByPlayerCondition.killedByPlayer())
1275
						.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
1276
				)
1277
		);
1278
	}
1279
1280
	public LootTable.Builder elderGuardianLootTable() {
1281
		return LootTable.lootTable()
1282
			.withPool(
1283
				LootPool.lootPool()
1284
					.setRolls(ContextIntProviders.exactly(1))
1285
					.add(
1286
						LootItem.lootTableItem(Items.PRISMARINE_SHARD)
1287
							.apply(SetItemCountFunction.setCount(ContextIntProviders.between(0, 2)))
1288
							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1289
					)
1290
			)
1291
			.withPool(
1292
				LootPool.lootPool()
1293
					.setRolls(ContextIntProviders.exactly(1))
1294
					.add(
1295
						LootItem.lootTableItem(Items.COD)
1296
							.setWeight(3)
1297
							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1298
							.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
1299
					)
1300
					.add(
1301
						LootItem.lootTableItem(Items.PRISMARINE_CRYSTALS)
1302
							.setWeight(2)
1303
							.apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.enchantments, ContextFloatProviders.between(0.0F, 1.0F)))
1304
					)
1305
					.add(EmptyLootItem.emptyItem())
1306
			)
1307
			.withPool(
1308
				LootPool.lootPool()
1309
					.setRolls(ContextIntProviders.exactly(1))
1310
					.add(LootItem.lootTableItem(Blocks.WET_SPONGE))
1311
					.when(LootItemKilledByPlayerCondition.killedByPlayer())
1312
			)
1313
			.withPool(
1314
				LootPool.lootPool()
1315
					.setRolls(ContextIntProviders.exactly(1))
1316
					.add(
1317
						NestedLootTable.lootTableReference(this.lootTables.getOrThrow(BuiltInLootTables.FISHING_FISH))
1318
							.apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot()))
1319
					)
1320
					.when(LootItemKilledByPlayerCondition.killedByPlayer())
1321
					.when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.enchantments, 0.025F, 0.01F))
1322
			)
1323
			.withPool(
1324
				LootPool.lootPool()
1325
					.setRolls(ContextIntProviders.exactly(1))
1326
					.add(EmptyLootItem.emptyItem().setWeight(4))
1327
					.add(LootItem.lootTableItem(Items.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE).setWeight(1))
1328
			);
1329
	}
1330
}
1331

Decompiled Minecraft 26.3 source of VanillaEntityLoot (net/minecraft/data/loot/packs/VanillaEntityLoot.java) with Mojang official mappings, stored verbatim on the site.