Posted July 26, 20232 yr Im making a sword that swings down if you right click and I need to select what entities take damage how would I make it so all entities take damage in a arcgoing from above your head to the ground in front of you with 1 block width and around 5 block height at its peak and 5 block length at its longest. I can get down the animation and stuff but I still need help figuring out how to select which entities take damage
July 26, 20232 yr I think this should work: ServerPlayer player = ...; double radius = 8; List<LivingEntity> list = player.level().getEntitiesOfClass(LivingEntity.class, player.getBoundingBox().inflate(radius,radius,radius), e->(/*filter entities and return true if accetted*/true));
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.