#Help with getting the TOGGLE feature to work

27 messages · Page 1 of 1 (latest)

verbal bronze
#

Above are the files for my customclass, ModBlocks of the three blocks and the blockstates of the one block which id like to show the different blockstates

inner flare
#
  1. You need to set both FACING and TOGGLE to a default value in the constructor.
  2. You need to add both in the appendProperties function
verbal bronze
#

I’d like to stress I’m a beginner at this stuff

inner flare
verbal bronze
#

I’ve looked through this but can’t find anything about a toggle variations, just true and false which can only be applied to two models or textures where as I need 3 @inner flare

slim roost
#

There may be a tristate property, otherwise just make your own.

verbal bronze
#

Just make ur own? Bro im beond a noob lol, those wiki and guide pages dont specify anything about a toggle blockstate with multiple states so it isnt as easy for me as just making my own @slim roost

slim roost
#

EnumProperty.create("toggle", YourEnumWith3Elements.class)

verbal bronze
#

And this would go into what file?

slim roost
#

that is the entire property

#
EnumProperty<E> TOGGLE = EnumProperty.create("toggle", E.class);

where E is your enum

verbal bronze
#

Right but where do i actually enter this stuff?

verbal bronze
#

@slim roost something like this? Not sure why create is red tho

slim roost
#

why do you pass 0,3?

verbal bronze
#

Seen someone do that online to say theres three models

slim roost
#

you gotta learn java first

verbal bronze
#

Tbh ive not needed to for any of the previous stuff ive done with other class and properties, this is the first one that I need this much help for lol

#

How should my properties/custom class file look like tho? Are the images i sent along the right lines? As id like my blocks to both place facing me and to have the 3 different model blockstates under toggle

slim roost
#

That is just an enum with 3 elements. It looks correct except that random 0,3.

verbal bronze
#

Deleted that part but still got the .create in red for some reaosn

slim roost
#

It should tell you what's wrong

#

I can't help you any further if you don't know java

verbal bronze
#

should it be of instead of create?

verbal bronze
#

Figured it out myself, IntProperty is easier than this