Posted April 28, 20214 yr I was wondering how I could check for a radius around the player, so that I can sort any living entities into a list? The concept is I want any living entities that come in a specific radius of the player to be set on fire.
April 28, 20214 yr Get the player's bounding box, make it bigger (grow, expand), and there are a couple methods in World called getEntitiesWithinAABB or something similar where returns a collection of entities that meets the conditions. If you want it to be more accurate (bounding box is a cube), you can also check the distance between two entities by Vector3d#distanceTo.
April 28, 20214 yr Author Hmm, I'm guessing getEntitiesWithinAABB doesn't exist in the 1.16 version because I can't seem to find the method?
April 29, 20214 yr It's probably called something else in mojmap compared to the mcp name provided. A quick search using the forge bot lands us with World#getEntities.
April 30, 20214 yr Author Ok, so I did find this method called getNearbyEntities and started playing around with it, but I'm having trouble figuring out what to put in the place of some of these parameters getNearbyEntities(Class<? extends T> p_217374_1_, EntityPredicate p_217374_2_, LivingEntity p_217374_3_, AxisAlignedBB p_217374_4_) I had already gotten that AxisAlignedBB is just the bounding box aka the radius to check and I just assume EntityPredicate could just be the default, but the other two I'm unsure about if anyone could explain?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.