Posted June 9, 20205 yr Hello, I followed Cadiboo tutorial that uses Forge Docs, and I'm trying to create an interactible block, but I can't find why I get this property error. I understand that it comes from the blockState of my InterfaceBlock (extending HorizontalBlock), but I don't know if it comes from the registry method I used or another circumstance. My github is https://github.com/Elsopeen/LyokoMod-1.15, and I added the stacktrace with the error (which indicated me that it came from my InterfaceBlock). I hope you can find the problem, and I thank you in advance stacktrace.log Edited June 9, 20205 yr by Elsopeen
June 9, 20205 yr Just guessing, you might need to override fillStateContainer and pass that property into the builder yeah I think you will need to do this Edited June 9, 20205 yr by poopoodice
June 9, 20205 yr Author Well, I added this override but I still have the error. So here's what I added, maybe it's not right : @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { super.fillStateContainer(builder.add(DirectionProperty.create("interface_direction", Direction.Plane.HORIZONTAL))); }
June 9, 20205 yr 1 minute ago, Elsopeen said: Well, I added this override but I still have the error. So here's what I added, maybe it's not right : @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { super.fillStateContainer(builder.add(DirectionProperty.create("interface_direction", Direction.Plane.HORIZONTAL))); } There's no reason calling super, just use the property you already have which is builder.add(HORIZONTAL_FACING); Edited June 9, 20205 yr by poopoodice
June 9, 20205 yr Author Thanks ! The problem is fixed ! But now the block doesn't seem to be able to rotate (or be placed in another direction...) Edit: the setblock command can rotate it ! Edited June 9, 20205 yr by Elsopeen Setblock test
June 9, 20205 yr you will need to override some methods such as getStateForPlacement() which provides a blockstate for the blockitem to determine what states does the block have when added, normally something like return getDefaultState() .with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing()); The rotate method you override is probably for structure generation or so.. not so sure. Edited June 9, 20205 yr by poopoodice
June 9, 20205 yr Author Thanks, I already done that (got the solution from another problem I looked up before). I'll mark this one as solved, thanks again !
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.