right click on grass block and then spawn pebbles

Started by Alexia_74 on

Topic category: Help with modding (Java Edition)

Last seen on 09:04, 15. Apr 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
right click on grass block and then spawn pebbles

Hello I made little procedure to get pebbles when right clicking on grass block. I tryed it and it work, exept I can right click any block and it will give me pebbles.
here my code:


In reality i have a second issue i don't really want right click on vanilla grass block but i need to right click on Terrafirmacraft grass block (any grass block if possible)

Thank in advance if someone can help me for that.

Last seen on 15:22, 13. May 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use "if is block at…
Thu, 04/06/2023 - 12:56

You can use "if is block at x y z tagged in (tag)" condition to make sure that it is a grass block, you can replace (tag) with any tag for a block, I think if you click on one of the buttons at the top of the screen it will pull up a list of common tags, including a grass one.

Last seen on 09:04, 15. Apr 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you I tryed with "if…
Thu, 04/06/2023 - 16:42

thank you I tryed with "if condition" but now my game crash when i use right click on a grass.

I did that

 

And I got this error when my game crash:

The game crashed whilst unexpected error

Error: net.minecraft.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: #tfc:grass

 

 

Last seen on 09:04, 15. Apr 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just tryed with "tagged in…
Thu, 04/06/2023 - 17:20

I just tryed with "tagged in block as": tfc:grass game doesnt crash when right click but don't give pebbles
 

Last seen on 11:35, 9. Apr 2023
Joined Aug 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The solution is easy. create…
Fri, 04/07/2023 - 16:29
The solution is easy. create a code with minecraft blocks that does what you want, check it and when it works, we edit the code

how to edit the code: click the left button on the procedure, it lights up but it does not open, then on the left side 4 options under the plus sign to add, we have to edit the code of the selected element, we click on it and open it, then we search The emitter block in this case would be grass (note that grass is not the same as ground with grass) and we change it by hand writing the TF block.
Then we do the same with the receiver, that is, in pebble, we change the name of the minecraft block to that of TF and click save code, you have the option at the top and it would be compatible with TF without any problem.

Last seen on 15:22, 13. May 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry I took so long to…
Sat, 04/08/2023 - 17:35

Sorry I took so long to respond.  you can use the procedure I have written below without needing custom code, I have tested it and it will work.  Different procedure blocks are marked as (block(sub-block) [configurable sub-part])

"(If(Is (get block at (x) (y) (z)) material type [grass])

do     (spawn item/gem (pebble) at (x) (y) (z))"

I realized that there is no grass tag in vanilla minecraft or forge.  I thought I remembered one being there, but I still should have checked.