Jump to content

Recommended Posts

Posted (edited)

I'm trying to make my own loot table, but for some reason, it just isn't working. I got it to work once when I was testing how the json file worked, but I haven't been able to get to work since

Spoiler

[00:17:46] [Server thread/ERROR]: Couldn't load loot table neem:flayerloot from file:/C:/Users/JEHan/Desktop/Exploration%20Expanded/bin/assets/neem/loot_tables/flayerloot.json
com.google.gson.JsonParseException: Loot Table "neem:flayerloot" Missing `name` entry for pool #0
    at net.minecraftforge.common.ForgeHooks.readPoolName(ForgeHooks.java:1230) ~[ForgeHooks.class:?]
    at net.minecraft.world.storage.loot.LootPool$Serializer.deserialize(LootPool.java:152) ~[LootPool$Serializer.class:?]
    at net.minecraft.world.storage.loot.LootPool$Serializer.deserialize(LootPool.java:147) ~[LootPool$Serializer.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) ~[TypeAdapterRuntimeTypeWrapper.class:?]
    at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[ArrayTypeAdapter.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:868) ~[Gson.class:?]
    at com.google.gson.Gson$1.deserialize(Gson.java:126) ~[Gson$1.class:?]
    at net.minecraft.util.JsonUtils.deserializeClass(JsonUtils.java:354) ~[JsonUtils.class:?]
    at net.minecraft.util.JsonUtils.deserializeClass(JsonUtils.java:376) ~[JsonUtils.class:?]
    at net.minecraft.world.storage.loot.LootTable$Serializer.deserialize(LootTable.java:210) ~[LootTable$Serializer.class:?]
    at net.minecraft.world.storage.loot.LootTable$Serializer.deserialize(LootTable.java:205) ~[LootTable$Serializer.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?]
    at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?]
    at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:1154) ~[ForgeHooks.class:?]
    at net.minecraft.world.storage.loot.LootTableManager$Loader.loadBuiltinLootTable(LootTableManager.java:148) [LootTableManager$Loader.class:?]
    at net.minecraft.world.storage.loot.LootTableManager$Loader.load(LootTableManager.java:71) [LootTableManager$Loader.class:?]
    at net.minecraft.world.storage.loot.LootTableManager$Loader.load(LootTableManager.java:52) [LootTableManager$Loader.class:?]
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
    at net.minecraft.world.storage.loot.LootTableManager.getLootTableFromLocation(LootTableManager.java:39) [LootTableManager.class:?]
    at net.minecraft.entity.EntityLiving.dropLoot(EntityLiving.java:593) [EntityLiving.class:?]
    at net.minecraft.entity.EntityLivingBase.onDeath(EntityLivingBase.java:1255) [EntityLivingBase.class:?]
    at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:1086) [EntityLivingBase.class:?]
    at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:80) [EntityMob.class:?]
    at net.minecraft.entity.player.EntityPlayer.attackTargetEntityWithCurrentItem(EntityPlayer.java:1415) [EntityPlayer.class:?]
    at net.minecraft.entity.player.EntityPlayerMP.attackTargetEntityWithCurrentItem(EntityPlayerMP.java:1406) [EntityPlayerMP.class:?]
    at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:1084) [NetHandlerPlayServer.class:?]
    at net.minecraft.network.play.client.CPacketUseEntity.processPacket(CPacketUseEntity.java:94) [CPacketUseEntity.class:?]
    at net.minecraft.network.play.client.CPacketUseEntity.processPacket(CPacketUseEntity.java:15) [CPacketUseEntity.class:?]
    at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) [PacketThreadUtil$1.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
    at net.minecraft.util.Util.runTask(Util.java:29) [Util.class:?]
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:754) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:699) [MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
[00:17:47] [Server thread/INFO]: Saving and pausing game...
[00:17:48] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
[00:17:48] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
[00:17:48] [Server thread/INFO]: Saving chunks for level 'New World'/The End

{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "weight": 100,
                    "name": "minecraft:stone"
                }
            ]
        }
    ]
}

 

Edited by GooberGunter
Posted

Forge requires that each loot pool in mod loot tables specifies a "name" property with a name that's unique to the loot table.

 

This is so that mods can modify/remove loot pools in LootTableLoadEvent.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Ok, that's why. Thanks!

I just updated it with the code I originally wanted and I get the enchanted book, but it doesn't have an enchantment, I figured that the following would have worked

{
    "pools": [
        {
			"name":"main",
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "weight": 100,
                    "name": "enchanted_book",
					"functions": [{
						"function":"enchant_randomly"
					}]
                }
            ]
        }
    ]
}

But I just get a blank enchanted book

Posted

You need to use minecraft:book, not minecraft:enchanted_book for the enchant_randomly function.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.