use of net.minecraft.world.storage.loot.LootEntryItem in project MinecraftForge by MinecraftForge.
the class LootTablesDebug method lootLoad.
@SubscribeEvent
public void lootLoad(LootTableLoadEvent event) {
if (!event.getName().equals(LootTableList.CHESTS_SPAWN_BONUS_CHEST))
return;
// Remove axes and replace with chestpeice, First vanilla entry is always called "main"
//Note: This CAN NPE if another mod removes things
LootPool main = event.getTable().getPool("main");
main.removeEntry("minecraft:wooden_axe");
main.removeEntry("minecraft:stone_axe");
main.addEntry(new LootEntryItem(Items.DIAMOND_CHESTPLATE, 1, 0, new LootFunction[0], new LootCondition[0], MODID + ":diamond_chestplate"));
// Get rid of all building mats. Which is pool #3, index starts at 0, but 0 is named "main"
event.getTable().removePool("pool3");
}
use of net.minecraft.world.storage.loot.LootEntryItem in project ConvenientAdditions by Necr0.
the class ModLoot method onLootTableLoad.
@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event) {
ResourceLocation n = event.getName();
if (n.equals(LootTableList.CHESTS_END_CITY_TREASURE)) {
if (ModConfigTools.mobCatcher_loot)
event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherMega, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":megaMCD"));
} else if (n.equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR)) {
if (ModConfigTools.mobCatcher_loot)
event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherHyper, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":hyperMCD"));
} else if (n.equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) {
if (ModConfigTools.mobCatcher_loot) {
event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherSuper, 1, 3, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":superMCD"));
event.getTable().getPool("main").addEntry(new LootEntryItem(ModItems.itemMobCatcherRegular, 3, -2, new LootFunction[0], new LootCondition[0], ModConstants.Mod.MODID + ":regularMCD"));
}
}
}
Aggregations