Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey. I have a helper method that i use when i export from a schematic to java(which hasn't been updated to the BlockPos format). I want to check if the block is a chest then fill it with loot. However, i get a strange error when i do:

 

 

 

[07:16:10] [server thread/ERROR]: Couldn't load loot table backtolife:village_scientist from file:/C:/Users/alexr_000/Desktop/Mods/BackToLife/bin/assets/backtolife/loot_tables/village_scientist.json
com.google.gson.JsonParseException: Loot Table "backtolife:village_scientist" Missing `name` entry for pool #0
at net.minecraftforge.common.ForgeHooks.readPoolName(ForgeHooks.java:1088) ~[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:378) ~[JsonUtils.class:?]
at net.minecraft.util.JsonUtils.deserializeClass(JsonUtils.java:400) ~[JsonUtils.class:?]
at net.minecraft.world.storage.loot.LootTable$Serializer.deserialize(LootTable.java:209) ~[LootTable$Serializer.class:?]
at net.minecraft.world.storage.loot.LootTable$Serializer.deserialize(LootTable.java:204) ~[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:1012) ~[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.tileentity.TileEntityLockableLoot.fillWithLoot(TileEntityLockableLoot.java:55) [TileEntityLockableLoot.class:?]
at net.minecraft.tileentity.TileEntityChest.createContainer(TileEntityChest.java:487) [TileEntityChest.class:?]
at net.minecraft.entity.player.EntityPlayerMP.displayGUIChest(EntityPlayerMP.java:860) [EntityPlayerMP.class:?]
at net.minecraft.block.BlockChest.onBlockActivated(BlockChest.java:420) [blockChest.class:?]
at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:475) [PlayerInteractionManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processRightClickBlock(NetHandlerPlayServer.java:707) [NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) [CPacketPlayerTryUseItemOnBlock.class:?]
at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) [CPacketPlayerTryUseItemOnBlock.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
at net.minecraft.util.Util.runTask(Util.java:25) [util.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:740) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:685) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:534) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]

 

 

 

my code:

 

 

    public static final ResourceLocation SCIENTIST_CHEST = LootTableList.register(new ResourceLocation("backtolife", "village_scientist"));
    
public static void setBlock(World world, int x, int y, int z, Block block, int meta, int flags){
	BlockPos pos = new BlockPos(x, y, z);
	world.setBlockState(pos, block.getStateFromMeta(meta), flags);
	if(block instanceof BlockChest){
		TileEntity tileentity1 = world.getTileEntity(pos);
            if (tileentity1 instanceof TileEntityChest)
            {
                ((TileEntityChest)tileentity1).setLootTable(SCIENTIST_CHEST, rand.nextLong());
            }
	}
}

 

 

Post the loot table JSON

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
{
    "pools": [
        {
            "rolls": {
                "min": 3,
                "max": 8
            },
            "entries": [
                {
                    "type": "item",
                    "name": "minecraft:diamond",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ],
                    "weight": 3
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_ingot",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 5
                            }
                        }
                    ],
                    "weight": 10
                },
                {
                    "type": "item",
                    "name": "minecraft:gold_ingot",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ],
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:bread",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ],
                    "weight": 15
                },
                {
                    "type": "item",
                    "name": "minecraft:apple",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ],
                    "weight": 15
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_pickaxe",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_sword",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_chestplate",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_helmet",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_leggings",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_boots",
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:obsidian",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 3,
                                "max": 7
                            }
                        }
                    ],
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:sapling",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 3,
                                "max": 7
                            }
                        }
                    ],
                    "weight": 5
                },
                {
                    "type": "item",
                    "name": "minecraft:saddle",
                    "weight": 3
                },
                {
                    "type": "item",
                    "name": "minecraft:iron_horse_armor",
                    "weight": 1
                },
                {
                    "type": "item",
                    "name": "minecraft:golden_horse_armor",
                    "weight": 1
                },
                {
                    "type": "item",
                    "name": "minecraft:diamond_horse_armor",
                    "weight": 1
                }
            ]
        }
    ]
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.