Topic category: Help with Minecraft modding (Java Edition)
I've been looking for a way to check for a block at a relative position to another and copy it into an inventory. It's for a drill-like block that breaks the block next to it and puts it inside a slot in the drill. I'm having trouble figuring out a way to do this without having to check for every specific block, like "If block at y+1 = stone, insert stone in slot 0". That would be inefficient and tedious. What I want is something like "if block at y+1 is solid, set get block at y+1 in slot 0 of inventory". After watching a few tutorial videos and searching topics on the forum, I haven't found an answer yet. If anyone knows if this is possible and/or how to do it please let me know. I really appreciate it, and if I figure it out on my own, I will make sure to post the solution either on this thread or another forum section. Thank you!
https://imgur.com/a/LeeEBln
How about the above?
This may be what you are looking for.
@Belselk_ That's exactly what I'm looking for! Thank you so much, I was close but that's way better. I opted to breaking the block in front of it, and then using the "convert Get nearest entity of item type to itemstack" function. Didn't think I could use it to get block, I wonder what else it can do.