Jump to content

Recommended Posts

Posted (edited)

For about 2 weeks now I can't figure out what my mistake is.
In general, at first I just made a block on which I pulled an oriented texture, and it worked perfectly, but then when I started trying to add functionality to the block (ripping it off the furnace functionality) Minecraft started complaining that it couldn't find the required parameter in the block, I checked everything, it looks correct (and before that it worked), it seems to be registered during installation.
The only thing I can blame is that it was necessary to somehow register abstract classes or somehow think about blockentity.

I forgot to mention, this happens when placing a block in the world, the texture on the item itself is normal.

Error:

java.lang.IllegalArgumentException: Cannot set property DirectionProperty{name=facing, clazz=class net.minecraft.core.Direction, values=[north, east, south, west, up, down]} as it does not exist in Block{infernaltech:geothermal_generator}
    at net.minecraft.world.level.block.state.StateHolder.setValue(StateHolder.java:122) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading}
    at ru.artem.alaverdyan.infernaltech.common.block.Mechanism.getStateForPlacement(Mechanism.java:69) ~[main/:?] {re:classloading}
    at net.minecraft.world.item.BlockItem.getPlacementState(BlockItem.java:119) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading}
    at net.minecraft.world.item.BlockItem.place(BlockItem.java:65) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading}
    at net.minecraft.world.item.BlockItem.useOn(BlockItem.java:46) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading}
    at net.minecraft.world.item.ItemStack.lambda$useOn$10(ItemStack.java:274) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading,xf:fml:forge:itemstack}
    at net.minecraft.world.item.ItemStack.onItemUse(ItemStack.java:289) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading,xf:fml:forge:itemstack}
    at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:274) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading,xf:fml:forge:itemstack}
    at net.minecraft.client.multiplayer.MultiPlayerGameMode.performUseItemOn(MultiPlayerGameMode.java:337) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.multiplayer.MultiPlayerGameMode.lambda$useItemOn$4(MultiPlayerGameMode.java:292) ~[forge-1.20.4-49.1.13_mapped_official_1.20.4.jar:?] {re:classloading,pl:runtimedistcleaner:A}


Mechanism.java

  Reveal hidden contents

GeothermalGenerator.java

  Reveal hidden contents

blockstates\geothermal_generator.json

  Reveal hidden contents

 

Edited by Mega4oSS
translation error
Posted

You're using the wrong FACING property in Mechanism#getStateForPlacementBlockStateProperties.FACING instead of Mechanism.FACINGHorizontalDirectionalBlock.FACING or BlockStateProperties.HORIZONTAL_FACING (which all refer to the same value). The former includes all six Direction values, the latter only includes the four horizontal values.

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
  On 1/4/2025 at 3:28 AM, Choonster said:

You're using the wrong FACING property in Mechanism#getStateForPlacementBlockStateProperties.FACING instead of Mechanism.FACINGHorizontalDirectionalBlock.FACING or BlockStateProperties.HORIZONTAL_FACING (which all refer to the same value). The former includes all six Direction values, the latter only includes the four horizontal values.

Expand  

 

Thank you very much, it works.

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.