A BETTER way of making projectiles deflectable.

Started by N3R3SH on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A BETTER way of making projectiles deflectable.

Recently, I made a post about how to make a projectile deflectable, based on help from Evistix466 on this forum topic: https://mcreator.net/forum/103087/how-can-i-create-scp-096-minecraft-1182
This is an improved version of that, which should work on anything you tag as deflectable, including vanilla projectiles, projectiles from other mods or even non-projectiles (idk why you would want that but that's up to you)
Unlike before, this runs when you (the player) swing in air, not on tick update of the projectile.
It also goes further away from what Evistix came up with by not sticking that much to the block grid anymore, instead measuring distance between the coordinates of each checked point along your view vector and the coordinates of the projectile, so the precision should be improved a lot.
It still requires 2 plugins, but this time those are Procedures+ and RedWires Plugin.
This version is only 1 procedure, not 2.
Make your tag with the projectiles you want to be deflectable, then a gamerule to adjust precision, then this procedure.
If you don't want precision to be adjustable, you can just replace the gamerule with whatever number you want (I recommend at least 3)