[09Jul2025 19:41:12.192] [Worker-Main-15/ERROR] [net.minecraftforge.common.ForgeHooks/]: Couldn't parse element loot_tables:prehistoricascension:blocks/ginkgo_knuckles
com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'prehistoricascension:ginkgo_knuckles'
at net.minecraft.util.GsonHelper.lambdaconvertToItem0(GsonHelper.java:145) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?]
at net.minecraft.util.GsonHelper.convertToItem(GsonHelper.java:145) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.util.GsonHelper.getAsItem(GsonHelper.java:153) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.entries.LootItemSerializer.deserialize(LootItem.java:55)[forge−1.20.1−47.4.1Serializer.deserialize(LootItem.java:40) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainerSerializer.deserializeCustom(LootPoolSingletonContainer.java:129) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainerSerializer.deserialize(LootPoolEntryContainer.java:74) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.GsonAdapterFactoryGsonContextImpl.deserialize(TreeTypeAdapter.java:179) ~[gson-2.10.jar%23130!/:?]
at net.minecraft.util.GsonHelper.convertToObject(GsonHelper.java:463) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.util.GsonHelper.getAsObject(GsonHelper.java:471) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.LootPoolSerializer.deserialize(LootPool.java:189) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.Gson.fromJson(Gson.java:1214) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.Gson.fromJson(Gson.java:1319) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.Gson.fromJson(Gson.java:1290) ~[gson-2.10.jar%23130!/:?]
at com.google.gson.internal.bind.TreeTypeAdapterSerializer.deserialize(LootTable.java:294) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar%23191!/:?]
at net.minecraft.world.level.storage.loot.LootTablegetLootTableDeserializerscheduleElementParsescheduleElementParse5(LootDaAsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.util.concurrent.CompletableFutureWorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
[09Jul2025 19:41:25.438] [Render thread/ERROR] [net.minecraft.client.Minecraft/FATAL]: Unreported exception thrown!
java.lang.IllegalArgumentException: The stack count must be 1
at net.minecraftforge.common.ForgeHooks.lambdaonCreativeModeTabBuildContents17(ForgeHooks.java:1629) ~[forge-1.20.1-47.4.1_mapped_parchment_2023.09.03-1.20.1.jar:?]
at net.minecraft.world.item.CreativeModeTabstaticbuildAllTabContentsForEachOp2IteratorSpliterator.forEachRemaining(Spliterators.java:1845) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.ForEachOpsForEachOpmakeService$7(CommonDevLaunchHandler.java:135) ~[fmlloader-1.20.1-47.4.1.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?]
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]
public class GinkgoKnucklesItem extends BlockItem {
// Define an array of allowed blocks (you can add more here)
private static final Block[] ALLOWED_BLOCKS = {
ModBlocks.GINKO_LOG.get() // Currently only ginko_log; add more as needed, e.g., ModBlocks.ANOTHER_BLOCK.get()
};
public GinkgoKnucklesItem(Block block, Item.Properties properties) {
super(block, properties);
}
@Override
public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
BlockPos clickedPos = context.getClickedPos();
Direction face = context.getClickedFace();
BlockState clickedState = level.getBlockState(clickedPos);
// Check if the block being clicked on is in the allowed blocks list
boolean isAllowedBlock = false;
for (Block allowedBlock : ALLOWED_BLOCKS) {
if (clickedState.getBlock() == allowedBlock) {
isAllowedBlock = true;
break;
}
}
if (!isAllowedBlock) {
return InteractionResult.FAIL; // Fail if not on an allowed block
}
// The position to place the block is offset by the face clicked
BlockPos placePos = clickedPos.relative(face);
if (!level.getBlockState(placePos).canBeReplaced()) {
return InteractionResult.FAIL; // Can't place if the spot is occupied
}
// Get the block state with FACING set to DOWN (upside down)
BlockState placeState = getBlock().defaultBlockState().setValue(GinkgoKnucklesBlock.FACING, Direction.DOWN);
// Place the block
if (level.setBlock(placePos, placeState, 11)) {
return InteractionResult.sidedSuccess(level.isClientSide());
}
return InteractionResult.FAIL;
}
}
public static final RegistryObject<Block> GINKGO_KNUCKLES = BLOCKS.register("ginkgo_knuckles",
() -> new GinkgoKnucklesBlock(BlockBehaviour.Properties.copy(Blocks.SPRUCE_PLANKS).noOcclusion()));
It looks like you're encountering two main issues based on the error logs:
Loot Table Error: Minecraft can't find or recognize the item ID "prehistoricascension:ginkgo_knuckles" in the loot table for the block. This typically happens if the item isn't registered correctly or if there's a mismatch in IDs. By default, Forge generates a loot table for blocks, but it might fail if the item registry is incomplete.
Creative Tab Error: The "The stack count must be 1" error occurs when adding items to a creative tab with an invalid stack size or improper item instance. This is likely happening in your ModCreativeModTabs class where you're building the tab contents. You need to ensure you're adding valid ItemStack instances with proper stack sizes.
Your provided classes for GinkgoKnucklesBlock and GinkgoKnucklesItem are mostly correct, but I'll provide a complete, working setup. I'll also include fixes for the loot table and creative tab issues.
Fixes and Recommendations
1. Loot Table Fix
Create a manual loot table JSON file for the block to ensure it drops the correct item when broken.
This ensures the block drops itself (as an item) when broken. The error suggests the auto-generated loot table couldn't resolve the item ID, so manually defining it should fix this.
2. Creative Tab Fix
In your ModCreativeModTabs class (or wherever you define creative tabs), ensure you're adding the item (not the block) to the tab with a valid ItemStack.
Example fix for your creative tab code (based on the stack trace pointing to ModCreativeModTabs.lambda$static$1):
package net.newt.prehistoricascension.item; // Or your package
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.newt.prehistoricascension.PrehistoricAscension; // Your mod ID
import net.newt.prehistoricascension.block.ModBlocks; // Import if needed
import net.newt.prehistoricascension.item.ModItems; // Assuming you have a ModItems class
@Mod.EventBusSubscriber(modid = PrehistoricAscension.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModCreativeModTabs {
public static final CreativeModeTab PREHISTORIC_ASCENSION_TAB = CreativeModeTab.builder()
.title(Component.translatable("itemGroup.prehistoricascension"))
.icon(() -> new ItemStack(ModItems.GINKGO_KNUCKLES_ITEM.get())) // Use your block's item as icon if desired
.displayItems((parameters, output) -> {
// Add items with proper ItemStack; ensure stack size is valid (e.g., 1)
output.accept(new ItemStack(ModItems.GINKGO_KNUCKLES_ITEM.get())); // Add the Ginkgo Knuckles item
// Add other items or blocks as needed, using their item registry objects
})
.build();
}
Use ModItems.GINKGO_KNUCKLES_ITEM.get() to add the item, not the block.
Ensure all items added to the tab have a valid stack size (default for blocks is 64, but the error might be from another item; check your tab code).
3. Updated Classes and Registration
Your GinkgoKnucklesBlock and GinkgoKnucklesItem classes are already mostly correct, but I'll provide them again for completeness with any minor tweaks. Ensure you have separate registry classes for blocks and items (e.g., ModBlocks.java and ModItems.java).
GinkgoKnucklesBlock.java (unchanged from your last version, but included for reference):
package net.newt.prehistoricascension.block.custom;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
public class GinkgoKnucklesBlock extends Block {
public static final DirectionProperty FACING = BlockStateProperties.FACING;
public GinkgoKnucklesBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.DOWN)); // Default to facing down (upside down)
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING); // Add the FACING property
}
}
GinkgoKnucklesItem.java (unchanged, but ensure it's correct):
package net.newt.prehistoricascension.block.custom;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.newt.prehistoricascension.block.ModBlocks; // Import your ModBlocks class
public class GinkgoKnucklesItem extends BlockItem {
// Define an array of allowed blocks (you can add more here)
private static final Block[] ALLOWED_BLOCKS = {
ModBlocks.GINKO_LOG.get() // Currently only ginko_log; add more as needed
};
public GinkgoKnucklesItem(Block block, Item.Properties properties) {
super(block, properties);
}
@Override
public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
BlockPos clickedPos = context.getClickedPos();
Direction face = context.getClickedFace();
BlockState clickedState = level.getBlockState(clickedPos);
// Check if the block being clicked on is in the allowed blocks list
boolean isAllowedBlock = false;
for (Block allowedBlock : ALLOWED_BLOCKS) {
if (clickedState.getBlock() == allowedBlock) {
isAllowedBlock = true;
break;
}
}
if (!isAllowedBlock) {
return InteractionResult.FAIL; // Fail if not on an allowed block
}
// The position to place the block is offset by the face clicked
BlockPos placePos = clickedPos.relative(face);
if (!level.getBlockState(placePos).canBeReplaced()) {
return InteractionResult.FAIL; // Can't place if the spot is occupied
}
// Get the block state with FACING set to DOWN (upside down)
BlockState placeState = getBlock().defaultBlockState().setValue(GinkgoKnucklesBlock.FACING, Direction.DOWN);
// Place the block
if (level.setBlock(placePos, placeState, 11)) {
return InteractionResult.sidedSuccess(level.isClientSide());
}
return InteractionResult.FAIL;
}
}
Registration Code (in ModBlocks.java and ModItems.java or a combined registry class):
Ensure you have both block and item registered with the same ID.
Example in ModBlocks.java (for the block):
package net.newt.prehistoricascension.block;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.newt.prehistoricascension.PrehistoricAscension; // Your mod class
import net.newt.prehistoricascension.block.custom.GinkgoKnucklesBlock;
public class ModBlocks {
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, PrehistoricAscension.MOD_ID);
public static final RegistryObject<Block> GINKGO_KNUCKLES = BLOCKS.register("ginkgo_knuckles",
() -> new GinkgoKnucklesBlock(BlockBehaviour.Properties.copy(Blocks.SPRUCE_PLANKS).noOcclusion()));
}
In ModItems.java (for the item):
package net.newt.prehistoricascension.item;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.newt.prehistoricascension.PrehistoricAscension; // Your mod class
import net.newt.prehistoricascension.block.ModBlocks;
import net.newt.prehistoricascension.block.custom.GinkgoKnucklesItem;
public class ModItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, PrehistoricAscension.MOD_ID);
public static final RegistryObject<Item> GINKGO_KNUCKLES_ITEM = ITEMS.register("ginkgo_knuckles",
() -> new GinkgoKnucklesItem(ModBlocks.GINKGO_KNUCKLES.get(), new Item.Properties().tab(ModCreativeModTabs.PREHISTORIC_ASCENSION_TAB)));
}
Make sure ModCreativeModTabs.PREHISTORIC_ASCENSION_TAB is correctly referenced (from the fixed creative tab code above).
4. Other JSON Files
Your provided JSON files (blockstate, model, etc.) look good, but ensure all file paths and references are correct:
Blockstate JSON: Correctly defines variants for the FACING property.
Model JSON: Uses the cross texture, which should work with your model.
Summary of Steps to Fix
Create the Loot Table File: Add ginkgo_knuckles.json in data/prehistoricascension/loot_tables/blocks/ with the provided content.
Fix Creative Tab Code: Update ModCreativeModTabs to add items using ItemStack and ensure valid stack sizes.
Verify Registration: Ensure both block and item are registered with the ID "ginkgo_knuckles" in separate registry objects.
Rebuild and Test: Clean your build (e.g., run gradlew clean if using Gradle), rebuild, and launch the game to check if errors are resolved.
If you still see issues, share your ModCreativeModTabs code or the full registry setup for further debugging. This should resolve the loot table and creative tab errors while keeping your block's upside-down placement logic intact.