Search in sources :

Example 1 with RandomValueRange

use of net.minecraft.world.storage.loot.RandomValueRange in project Gaspunk by Ladysnake.

the class ModItems method onLootTableLoad.

@SubscribeEvent
public static void onLootTableLoad(LootTableLoadEvent event) {
    if (event.getName().toString().equals("minecraft:chests/nether_bridge")) {
        ResourceLocation loc = new ResourceLocation(GasPunk.MOD_ID, "inject/nether_bridge");
        LootEntry entry = new LootEntryTable(loc, 1, 1, new LootCondition[0], "gaspunk_sulfur_entry");
        LootPool pool = new LootPool(new LootEntry[] { entry }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "gaspunk_sulfur_pool");
        event.getTable().addPool(pool);
    }
}
Also used : LootEntry(net.minecraft.world.storage.loot.LootEntry) RandomValueRange(net.minecraft.world.storage.loot.RandomValueRange) ResourceLocation(net.minecraft.util.ResourceLocation) LootPool(net.minecraft.world.storage.loot.LootPool) LootEntryTable(net.minecraft.world.storage.loot.LootEntryTable) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)1 LootEntry (net.minecraft.world.storage.loot.LootEntry)1 LootEntryTable (net.minecraft.world.storage.loot.LootEntryTable)1 LootPool (net.minecraft.world.storage.loot.LootPool)1 RandomValueRange (net.minecraft.world.storage.loot.RandomValueRange)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1