Posted June 26, 20232 yr So I want to check if an entity is standing still when it is attacked. I tried to use LivingEntity#getSpeed to see if the entity is standing still, but this doesn't work because the victim is pushed by the attacker and the speed never reads a zero. So is there any way to tell if a mob or player is trying to walk rather than just being pushed by something else? Edited June 26, 20232 yr by Braquen
June 27, 20232 yr check the deltas Vec3 vm = pe.getDeltaMovement(); if( (vm.x + vm.y + vm.z) > 0 ){ //stuff }
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.