Global Loot Modifier Generation
Global Loot Modifiers (GLMs) can be generated for a mod by subclassing GlobalLootModifierProvider
and implementing #start
. Each GLM can be added generated by calling #add
and specifying the name of the modifier, the serializer of the modifier, and the modifier instance to be serialized. After implementation, the provider must be added to the DataGenerator
.
// In some GlobalLootModifierProvider#start
this.add("example_modifier", EXAMPLE_MODIFIER_SERIALIZER, new ExampleModifier(
new LootItemCondition[] {
WeatherCheck.weather().setRaining(true).build() // Executes when raining
},
"val1",
10,
Items.DIRT
));