Converting Blocks in Your Minecraft World with an Item

Started by TertianClaw on

Topic category: Advanced modding

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Converting Blocks in Your Minecraft World with an Item
Tue, 12/05/2023 - 02:37 (edited)

I am new to the world of coding and have been repeating confusing myself with placing and aligning commands in order to make them do what I want. I want to know how to code an item so that when I right-click the item all of a specific block in the dimension will change into a different block. For example, I right click my custom item and all the stone blocks in the world transform into diamond blocks. I want to make it so that the specific pre-existing blocks change and not any stone placed after I used the item and the code finished executing.

 If you're also up to the challenge, I would love it if you explained to me how to convert a specific block like before, but now only on a specific y level. Again, for example I want my stone blocks to convert into diamond blocks. But now, I want only the stone blocks on Y level 9 to change into diamond blocks and not on any other level.

 

 

Edited by TertianClaw on Tue, 12/05/2023 - 02:37
Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sure. But just be aware, you…
Tue, 12/05/2023 - 06:07

Sure. But just be aware, you will have to create a custom stone block first.

Basically, in the triggers for your block there will be one that says "When player right-clicks on block". Click on the green plus symbol on the right side of it to create a new procedure. For Your procedure, it should be like this:

Go to the flow control area and get a block that says "If (something) do (insert block)".

Then go to the logic area and find the red equals block (insert item) = (insert item). Then in the entity data section find the "item in main hand of: Event/target entity". put this in the first end of the red equals block. Them go to minecraft components and find the red block with a grey square. Click on it to insert your own item. Put this in the other end of the red equals block.

after that, go to the block management area and grab the block at the top which should say "Place (choice block) at x: (x) y: (y) z: (z)". Change the empty slot to a diamond block. Then assemble these blocks as follows:

On trigger:

If: (item in main hand of: Event/target entity) = (Custom Item)

do: Place (Diamond_block) at x: (x) y: (y) z: (z)

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For creating a custom stone…
Sat, 12/09/2023 - 15:11

For creating a custom stone block, will that create an entirely different block from the world generated stone, or will it make all the stone in the world possessing that procedure.

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, is it required to…
Sun, 12/10/2023 - 00:47

Also, is it required to place in the coordinates because I'm using your procedure out without imputing the x y and z and it's not working. I want all the custom stone blocks to change not just ones at a specific x y and z. Do you know how to do that

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If the procedure looks like…
Mon, 12/11/2023 - 04:13

If the procedure looks like this, you've done it right and it should work.

 

 

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
However, if this is not to…
Mon, 12/11/2023 - 04:25

However, if this is not to your satisfaction, I figured out a procedure for the item, that would work on ordinary stone. 

PS, You need to open the image above in a new tab.

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much!! I looked…
Wed, 12/13/2023 - 02:21

Thank you so much!! I looked at the picture for your previous comment. Thats what I did, but it requires an input for the x y and z to work. Can you please send your new procedure for affecting ordinary stone.

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
By the way, you must do this…
Wed, 12/13/2023 - 13:15

By the way, you must do this procedure for "when right-clicked on block". Don't worry about the xyz coordinates, as these will be at the block location. Also, you can replace the procedure with this one, as it is simpler.

https://imgur.com/a/ZnF6cya 

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for your help this…
Wed, 12/13/2023 - 22:29

Thank you for your help this far!! I understand how your procedure works with right clicking the block and changing it. I just want to know one more thing. This code that you've shown me changes one block that the player right clicks. How would one go about changing all the stone blocks in the generated world, not just the ones the player has right clicked. If you don't know how to do it, that's fine!

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do you mean how would you…
Wed, 12/13/2023 - 23:08

Do you mean how would you change every stone block into diamond when you click on one?

Last seen on 17:56, 21. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes!! Thats what I would…
Wed, 12/13/2023 - 23:38

Yes!! Thats what I would like to know please .

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Um, I don't exactly know how…
Wed, 12/13/2023 - 23:41

Um, I don't exactly know how, but I will do my best to see.