Bug Closed · Resolved

Bug with damage to players

#10036 opened by vinrey123 1 week ago

vinrey123reported this bug

I found an issue with the damage mechanic when using projectile with onHit (oH).

If a mob is targeting Player A and the projectile hits Player A, the damage is applied correctly. However, if Player B is nearby and the projectile hits them instead, Player B does not take any damage. It seems that the damage mechanic continues to use the mob's current target (aggro target) instead of the player that the projectile actually hit.

I tested this with other mechanics. For example, shieldbreak works correctly: even if the boss is not targeting any player, when a projectile hits a player, their shield is still broken. The same applies to mechanics that apply potion effects — the effect is applied to the player who was actually hit by the projectile.

I have noticed this issue for about three years now. So I would like to ask: is this a bug in the damage mechanic, or am I using it incorrectly? If this is indeed a bug, I would appreciate any help fixing it or information about a possible workaround.

The skill I am using: SANDSTORM: Skills: - projectile{b=DISPLAY;mat=SAND;oS=SANDSTORM_S;oT=SANDSTORM_T;oH=SANDSTORM_H;oE=SANDSTORM_E;v=3;i=1;hR=0.3;vR=0.3;syo=12;sfo=-8to8;sso=-8to8;rots=0.1,0.1,0.1;scale=0.3,0.3,0.3;dd=0;mr=16;fo=true;repeat=80;repeatI=2} @origin{y=-90} SANDSTORM_S: Skills: - modifyProjectile{delay=15;t=VELOCITY;a=ADD;v=0.01;repeat=30;repeatI=1} - sound{s=block.sand.place;v=0.3;p=1.5} @origin SANDSTORM_T: Skills: - particles{delay=3;p=block_crack;m=SAND;a=1;hS=0;vS=0} @origin 0.25 SANDSTORM_H: Skills: - particles{p=block_crack;m=SAND;a=8;hS=0.5;vS=0.5} - shieldbreak{d=50to75} - damage{a=8to10} SANDSTORM_E: Skills: - particles{p=block_crack;m=SAND;a=1;hS=0.5;vS=0.5} @origin 0.35 - sound{s=block.sand.hit;v=0.3;p=1.5} @origin

Here is also a video demonstrating the skill: https://youtu.be/Z33jegoMp2k

vinrey123commented

I slightly messed up what I wrote, so here is my skill: SANDSTORM: Skills:

  • projectile{b=DISPLAY;mat=SAND;oS=SANDSTORM_S;oT=SANDSTORM_T;oH=SANDSTORM_H;oE=SANDSTORM_E;v=3;i=1;hR=0.3;vR=0.3;syo=12;sfo=-8to8;sso=-8to8;rots=0.1,0.1,0.1;scale=0.3,0.3,0.3;dd=0;mr=16;fo=true;repeat=80;repeatI=2} @origin{y=-90} SANDSTORM_S: Skills:
  • modifyProjectile{delay=15;t=VELOCITY;a=ADD;v=0.01;repeat=30;repeatI=1}
  • sound{s=block.sand.place;v=0.3;p=1.5} @origin SANDSTORM_T: Skills:
  • particles{delay=3;p=block_crack;m=SAND;a=1;hS=0;vS=0} @origin 0.25 SANDSTORM_H: Skills:
  • particles{p=block_crack;m=SAND;a=8;hS=0.5;vS=0.5}
  • shieldbreak{d=50to75}
  • damage{a=8to10} SANDSTORM_E: Skills:
  • particles{p=block_crack;m=SAND;a=1;hS=0.5;vS=0.5} @origin 0.35
  • sound{s=block.sand.hit;v=0.3;p=1.5} @origin
Sign in to join the discussion.