Started by
tbroski
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, I am trying to figure out how to [Get a block] from afar by raytracing. I see the [Entity look x/y/z position - raytrace distance]->[<Number Argument>] block in the Entity procedure category but am unsure how the number argument works, does it get the block the number argument away. Can someone please help me with this? Thanks!
It determines how far to trace
Is there a way to trace the first non-air block?
?
Did u ever figure out how to test for the first non air block, I am trying to do the same
Yes lol, I have used in java code;
But I believe there is a procedure block for the above in MCreator.
Just try make it 1000 blocks
Just in case someone finds this, the Raytrace traces a line on that axis, returning the block coordinates at the block distance (the number in the coding block). If you wanted to scan, you could make a local variable, and increment it until you found a non-air block. Then use the break loop block under flow control. Actually quite simple, but was goofing with the jaw, degrees, etc. until I realized how raytrace worked. The block directly in front (where a mob is facing) then use [x raydistance 1] and [z raydistance 1] and [y] the mobs y.
@kreatorKen Do you have the blocks for this? I'm trying to figure it out, but it's not too easy to understand what you said. I hope you'll react. Thanks already
Here is a tutorial I made: link