pearuhdox / Cartographer

A collection of datapacks for Minecraft 1.19 that add custom enchantments, mob attacks, and more, for use in CTM maps.
GNU General Public License v3.0
21 stars 2 forks source link

[Custom Enchantments] Missing checks when applying tags to tridents #21

Closed Compsogbrickus closed 1 year ago

Compsogbrickus commented 1 year ago

If a trident is closer to the player than the one they just threw, trident tags will get added to the wrong trident. This is because of cartographer_custom_enchantments:enchant_effects/apply_ranged_tags_trident, which has the line execute if score $temp ca.var matches 1.. at @s as @e[type=trident,limit=1,distance=..7,sort=nearest] run function cartographer_custom_enchantments:enchant_effects/branch/set_custom_trident

Similarly, if a riptide trident is closer to the player than a trident they just threw, it will force-trigger riptide for the player. This is because of cartographer_custom_enchantments:enchant_effects/riptide/start which has the line execute as @e[type=trident,distance=..5,sort=nearest,limit=1] run function cartographer_custom_enchantments:enchant_effects/riptide/trident_branch

This issue could be resolved by checking if the trident is already a custom trident, if it is owned by the player, and if it is not in the ground (interaction with Collapse?).

pearuhdox commented 1 year ago

This has been fixed by doing a check for if the trident is owned by a player. It will check all tridents within 7 blocks now instead of the nearest one to the player. This might cause some multiplayer dual throw trident/arrow issues so if needed, I will revisit the latter change.