为BEAST子弹添加击中音效
This commit is contained in:
parent
f22d9de943
commit
bc776aaf56
1 changed files with 11 additions and 1 deletions
|
@ -324,7 +324,17 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
living.remove(Entity.RemovalReason.KILLED);
|
living.remove(Entity.RemovalReason.KILLED);
|
||||||
living.gameEvent(GameEvent.ENTITY_DIE);
|
living.gameEvent(GameEvent.ENTITY_DIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.shooter instanceof ServerPlayer player) {
|
||||||
|
player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||||
|
capability.hitind = 25;
|
||||||
|
capability.syncPlayerVariables(living);
|
||||||
|
});
|
||||||
|
var holder = Holder.direct(TargetModSounds.INDICATION.get());
|
||||||
|
player.connection.send(new ClientboundSoundPacket(holder, SoundSource.PLAYERS, player.getX(), player.getY(), player.getZ(), 1f, 1f, player.level().random.nextLong()));
|
||||||
((ServerLevel) this.level()).sendParticles(ParticleTypes.DAMAGE_INDICATOR, living.getX(), living.getY() + .5, living.getZ(), 1000, .4, .7, .4, 0);
|
((ServerLevel) this.level()).sendParticles(ParticleTypes.DAMAGE_INDICATOR, living.getX(), living.getY() + .5, living.getZ(), 1000, .4, .7, .4, 0);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue