Spawn blocks in air with item?

Started by SimpleGingers on

Topic category: Help with MCreator software

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Spawn blocks in air with item?

I have created an item, given it the settings I wanted, and am on the triggers section of the creation. I want to make it so whenever I click with the wand I have, it creates a certain block (lets say stone) at a maximum of 10 blocks away from me, it can be in the middle of the air as well. If when i aim and use the item, there are already block closer to me in its path, it will place the block there at less of ten blocks away. Its basically placing blocks in the air. Now I have some experience in coding, but not much in this. How would I code or have a rough idea on how to code that onto an item? Could you explain to me what to do or link me to something similar to my idea and useful? 

 

Im new to MCcreator.

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There's probably a better…
Mon, 10/19/2020 - 22:30

There's probably a better way to do this, but this is the procedure I came up with:

https://drive.google.com/file/d/1LrqjtEJpNMhUSrwRO6s2GUuDwJgNX4nY/view?usp=sharing

The loop makes it so that it doesn't overshoot and end up replacing a block. I made it so that it uses the item from the player's offhand but you could modify the code to do something else. The important part is you can get the block n blocks away in the direction an entity is facing using the Look [x/y/z] position of (Event/target entity) with raytrace distance (n). If you need any help implementing this procedure or something similar for your own mod don't hesitate to ask a follow-up question.