#How can I get the entities within N blocks of a position?
10 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
if you have access to the Level you can use
level.getEntitiesOfClass(Class<T> clazz, AABB area, Predicate filter)
using the AABB to check a square around your position and then the predicate to check the distance
how do i construct an AABB from coordinates again? I have access to all the normal methods
This might help you
[Quote ➤](#archived-example-scripts message) Inworld Crafting 9000™️ by @lucid folio :nkoGiggle:
Allows for inworld crafting by throwing items on a block, the detection radius is 1.5blocks from the center of the block.
Once you have the recipe ingredients added, right-click the block with the Recipe Activation Item, and it will give you the output.
Will return any items that are not used in recipes, so you will not accidentally lose anything.
The third image will show the range of the crafting surface.
Crafting with NBT might be a bit wonky, that is still work in progress, use with caution.
Any fixes/updates/changes will be added and pinned in the thread