Started by
FlippinLegend
on
Topic category: Help with Minecraft modding (Java Edition)
I was wondering if it's possible for a flying entity to break only selected blocks and put the blocks they broke into chests. If that's possible. How?
I can how you can do that, but it is very complex, you kind can spawn flying entity that will fly to a certain high, if there is a chest under it ground level, it will start to verify each block in a determined radius around it, if the block is the block you want it to collect it will destroy it and place in the chest under it ground level, animations like mob flying toward object and down to the chest can be made to I guess. Do you have some math knowledgement about how to use sin and cos? If you do it will make it easier to explain how to do the verification
We don't need to do the math. There are methods dedicated for these sorts of things.
Since I believe we are on the same page that this needs to be coded, here goes;
CREATE A NEW ENTITY AI CLASS FOR FINDING AND "PICKING UP" ITEMENTITIES.
For finding item entities;
In one of the parameters specify for ItemEntity. If you want to find a specific item, iterate through the results.
Now use;
Use this to travel to an ItemEntity. Once nearby remove it.
CREATE A NEW ENTITY AI CLASS FOR FINDING AND BREAKING BLOCKS.
Since I have no clue what this means or how the blocks get selected;
Just get the BlockPos for your "selected block" and use;
Use this to travel to the block. Also, check the block hardness to make sure it is harvestable. If so, destroy it.
That should get you started.