Can I Set a Rule to Toggle Blocks in Bulk?

Started by Hiroyuki on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can I Set a Rule to Toggle Blocks in Bulk?

I've created 10 different blocks, and for each, I've also made a version that lights up. I want to be able to toggle these lights on and off with a right-click of a wand. For example, right-clicking a pink block with the wand would turn it into a lit pink block, and right-clicking a lit black block would turn off the light.

Currently, I am creating individual procedures for each block, which is quite cumbersome. Is there a way to create a universal rule or procedure? For instance, could I make a consolidated procedure that toggles the lit version of a block when it's right-clicked with a wand? I'm finding the process of doing this individually for each block to be difficult and prone to errors.

I'm a beginner with MCreator. If anyone knows how to do this, could you please guide me?

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, create a procedure and…
Sun, 01/05/2025 - 12:36

Yes, create a procedure and change it to OnPlayerRightClick or something similar

Check if the player has the wand in hand, then verify if the player is right-clicking the specified block

Note: I believe you can create tags in MCreator, so consider creating one and attaching it to all your blocks Then, check if the block has that tag.. it will make your code cleaner. However, feel free to do it as you wish.

Hope this helps :)