How do I make a block randomly rotate like stone?

Started by ankmaniac on

Topic category: General discussion

Active 4 years ago
Joined Feb 2021
Points:
537

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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.

Active 1 year ago
Joined Mar 2021
Points:
607

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 67
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?

Active 10 months ago
Joined Mar 2022
Points:
375

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5
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.