Question about the new Procedures system

Started by RebelDroideka on Mon, 06/11/2018 - 08:10

Topic category: Help with modding (Java Edition)

Last seen on 06:13, 17. Jul 2020
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Question about the new Procedures system
Mon, 06/11/2018 - 08:10

In the old Events system, it was possible to, without much work, have the event operation check if the block at (x,y,z) was a certain type of block. My question is, how does one go about doing this with the new Procedures system? The closest thing I can find to this is the Is Air At (x,y,z) code block.

Last seen on 06:13, 17. Jul 2020
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Also, how do I recreate the…
Mon, 06/11/2018 - 08:17

Also, how do I recreate the effect of the old Percentage Chance Event condition?

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Look around on the form…
Mon, 06/11/2018 - 18:32

Look around on the form these have already been answered.

Last seen on 06:13, 17. Jul 2020
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The only other question on…
Mon, 06/11/2018 - 19:14

The only other question on the forum even remotely similar to either of mine that was posted after MCreator 1.7.9, the version implementing the Procedures system, went live was this one: https://mcreator.net/forum/42077/detecting-specific-block-specific-posi…. This topic is UNANSWERED. The only post in the thread is the one posing the question.

I was completely unable to find any other topic where someone inquired about random number generators or percentage chance operations since MCreator 1.7.9 was released.

TL,DR: If these questions were actually answered, please provide link to the threads.

Last seen on 06:13, 17. Jul 2020
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
For anyone experiencing this…
Tue, 12/18/2018 - 09:04

For anyone experiencing this same difficulty, I have found a way to accomplish these things.

To check whether a block at a certain position is what you want it to be:

Under "block actions" there is a piece called "get block at". Use a block comparator piece, found under the logic operations tab in the procedure editor, and grab a "minecraft component" piece. Click on the grey box and select the block you want to check for. Be aware, MCreator does NOT distinguish between different types of, say, Log, Stone, or Wool. This deficiency is also present in the recipe creator; if you try to make a recipe that can use any type of wool, you will instead need to make 16 different recipes.

 

To calculate a random percentage chance:

Create a "local variable", name it whatever you want. Its name doesn't matter. Then, use the "random[0,1)" piece as input for a "set local variable" code piece. Then, using a number comparator piece, check if the variable is less than or equal to a decimal value. Feed that data into an if statement, and your percentage chance calculator is done.