How do I make a block randomly rotate like stone?

Started by ankmaniac on

Topic category: General discussion

Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a block randomly rotate like stone?

I'm designing a new block for 1.17 for a possible proposal to introduce into the game, limestone (gray because it doesn't include an oxidized mineral) and I don't want to replace the stone texture with it, so instead I'll just replace a useless block with the texture. Only issue is that from what I see only stone rotates 180 degrees randomly, so I was wondering how to make a block randomly rotate using a resource pack. Any help would be greatly appreciated.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Stone as no rotation on it…
Mon, 03/08/2021 - 12:41

Stone as no rotation on it most Minecraft blocks don't have any rotation on them at all this is by design and 1.17 is not out yet and wont be for a long time in MCreator if ever.

So can you help with that you mean better?

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For some reason I don't…
Sun, 09/25/2022 - 09:01

For some reason I don't quite understand, Mcreator doesn't like randomised block model rotations and will show a texture error when you use them. You might possibly have to make an external resource pack for the effect you desire (I'm not sure how well that would work). In a resource pack, you can make a block randomly rotate the way most vanilla blocks do by going to your block's JSON file in “yourpack\assets\[minecraft/modID]\blockstates” and using this code:

{
  "variants": {
    "": [
      {
        "model": "minecraft:block/example"
      },
      {
        "model": "minecraft:block/example",
        "y": 90
      },
      {
        "model": "minecraft:block/example",
        "y": 180
      },
      {
        "model": "minecraft:block/example",
        "y": 270
      }
    ]
  }
}

Just replace all instances of “example” with the name of the block's model, and replace the Minecraft namespace with your mod's.

However, to rotate the way stone does, you'll need two models, one being a mirrored version of the other, using this code:

{
  "variants": {
    "": [
      {
        "model": "minecraft:block/example"
      },
      {
        "model": "minecraft:block/example_mirrored"
      },
      {
        "model": "minecraft:block/example",
        "y": 180
      },
      {
        "model": "minecraft:block/example_mirrored",
        "y": 180
      }
    ]
  }
}

Once again, you'll need to make those same replacements.