Posted March 14, 20223 yr Hi, I have a problem with my mod, I created a custom property for my block and it is not recognized by the game. I'm attaching the class of my block as well as the piece of log with the error. Thanks in advance for the help ! Spoiler [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=east, smelting=false': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=south, smelting=false': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=west, smelting=true': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=south, smelting=true': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=east, smelting=true': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=west, smelting=false': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=north, smelting=false': Unknown blockstate property: ' smelting' [22:15:20] [Worker-Main-5/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'biodepths:blockstates/organic_furnace.json' in resourcepack: 'Mod Resources' for variant: 'facing=north, smelting=true': Unknown blockstate property: ' smelting' Spoiler public class OrganicFurnace extends BlockCore { public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public static final BooleanProperty SMELTING = BooleanProperty.create("smelting"); public OrganicFurnace(Material material, int harvestLevel, ToolType toolType, float strength, boolean requiresTool) { super(material, harvestLevel, toolType, strength, requiresTool); this.setDefaultState(this.getDefaultState().with(FACING, Direction.NORTH).with(SMELTING, Boolean.FALSE)); } @Nonnull @Override @SuppressWarnings("deprecation") @ParametersAreNonnullByDefault public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(!worldIn.isRemote()) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof OrganicFurnaceTile) { INamedContainerProvider containerProvider = createContainerProvider(worldIn, pos); NetworkHooks.openGui(((ServerPlayerEntity)player), containerProvider, tileEntity.getPos()); } else { throw new IllegalStateException("Our Container provider is missing!"); } } return ActionResultType.SUCCESS; } private INamedContainerProvider createContainerProvider(World worldIn, BlockPos pos) { return new INamedContainerProvider() { @Nonnull @Override public ITextComponent getDisplayName() { return new TranslationTextComponent("screen.biodepths.organic_furnace"); } @Override @ParametersAreNonnullByDefault public Container createMenu(int i, PlayerInventory playerInventory, PlayerEntity playerEntity) { return new OrganicFurnaceContainer(i, worldIn, pos, playerInventory, playerEntity); } }; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return InitElements.InitTileEntities.ORGANIC_FURNACE_TILE.getObj().getB().create(); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Nullable @Override @ParametersAreNonnullByDefault public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState() .with(FACING, context.getPlacementHorizontalFacing().getOpposite()) .with(SMELTING, Boolean.FALSE); } @Override @ParametersAreNonnullByDefault protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { super.fillStateContainer(builder); builder.add(FACING, SMELTING); } }
March 15, 20223 yr Author What does that mean? I don't quite understand, could you explain? I have created a smelting property in my block.
March 15, 20223 yr Author Oh thank you so much ! It works, I had put an extra space Edited March 15, 20223 yr by Olegueyan
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.