Block state up to 32 numbers or block state as string

Started by VegaOrionis on

Topic category: Help with MCreator software

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Block state up to 32 numbers or block state as string

I'd like to create a new variable in the class that will be the new state of the block. I'd like it to be limited to 32, not 25, or in the form of a string. I don't know Java :(
 

https://imgur.com/a/uRi140u

 

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When performing a specific…
Mon, 10/13/2025 - 15:25

When performing a specific action in the game, I change the value of the NBT tag called "testTag". Then, when the condition is met ("testTag" == 0 , testTag" == 1 etc.), an action should be performed which should set the blockState (of the IntegerProperty variable) (ageC) to the value 0, 1, 2 etc.
https://i.imgur.com/YR1Ir1b.png

The ageC variable is "pot"
https://i.imgur.com/fSiu5te.png

Then in the blockstate directory the bsmkii.json file
{
 "variants": {
  "pot=0": {
     "model": "xxxx:block/bsmkii"
   }, "pot=1" : {
     "model": "xxxx:block/p1"
   },
   "pot=2" : {
     "model": "xxxx:block/p2"
   },

will read the selected block to me. I want to control the type/appearance of the block using the nbt tag.
 

ufff....  It worked great for me in the previous version of mcreator.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What minecraft version are…
Mon, 10/13/2025 - 18:36

What minecraft version are you on now?

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MCreator 2021.2 - Forge 1.15…
Mon, 10/13/2025 - 18:59

MCreator 2021.2 - Forge 1.15.2

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know why but I…
Mon, 10/13/2025 - 19:36

I don't know why but I restarted the game and now it works.... On the one hand I'm happy, but on the other I'm angry why it didn't work before...

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
in version 2021.3 - 1.17.1…
Tue, 10/14/2025 - 21:59

in version 2021.3 - 1.17.1 nothing works for me anymore... I don't know how to fix it...

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sad.. and I wanted to update…
Tue, 10/14/2025 - 22:00

sad.. and I wanted to update the already finished mod to a newer version...

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah... you're going to have…
Tue, 10/14/2025 - 22:02

yeah... you're going to have trouble doing that, considering how much custom code it has

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just need to somehow…
Tue, 10/14/2025 - 22:05

I just need to somehow create a new variable that can be referenced via NTB TAG.

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I don't find a solution,…
Tue, 10/14/2025 - 22:15

If I don't find a solution, I'll probably have to do it manually and add dozens of blocks... But I'll somehow finish this mod in 2-3 more versions and publish it :)

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you've put your code between…
Wed, 10/15/2025 - 08:48

you've put your code between implements and EntityBlock when it should go in the body of the class,

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did you mean to use…
Wed, 10/15/2025 - 09:06

did you mean to use StateDefinition uppercase S ?