Started by
TheGeekyGeekMC
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make a custom EnumProperty blockstate for a "BuffetTable" block that is supposed to be able to be two blocks long (or longer). This is the custom element I used for the EnumProperty (based on Minecraft's "ChestType" enum from the decompiled code): https://pastebin.com/CdU7b1R9
And this is the code for the block: https://pastebin.com/LAW2PYUt
However, the code fails to compile and I get this in the console:https://pastebin.com/KXJRPrD3
Can you please help me with this? What is the correct way to make custom enum blockstates using code?
I think you may have experienced the same problem as I did. I followed this tutorial, https://mcreator.net/forum/87289/tutorial-20221-1182-change-block-modeltexture-ingame, but changed all things related to integer properties to enum. I received the cannot find symbol error and found out (thanks to ChatGPT) that I needed to implement StringRepresentable in the enum for Minecraft to read the values as strings. Here's how the code looked:
And here's a link to a post I made where I had the same problem, but later found the solution: https://mcreator.net/forum/99492/block-enum-property-issue.
Hope this helps!