#Custom shield not blocking all projectiles (RESOLVED)
1 messages · Page 1 of 1 (latest)
I've done this before, although as a projectile forcefield, not a shield.
The distance check of 2 is too low. If I'm remembering correctly an arrow can fly more than 2 blocks in a single tick.
would taking the arrow velocity and adding it to the position help while keeping the shield smaller do you think?
Yeah, that should work I think? You could predict where the arrow will be next tick and deflect it early.
well I think its working but now I think the distance calculations aren't working. like either the arrow will deflect waay too early or not at all :|
I would try logging out the velocity and seeing if it makes sense.
Sometimes the values are pretty wrong
looks like it's working now, I just took the position and added have of the velocity. added another check for the upper block that player exists in as well.