Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void slam(LivingEntity user) {
- if (user.isAlive()) {
- Vector3d look = user.getLookAngle();
- double d0 = (look.x() * this.getStrength()) * 1.5D;
- double d1 = (look.z() * this.getStrength()) * 1.5D;
- for (Entity entity : user.level.getEntitiesOfClass(LivingEntity.class, user.getBoundingBox().expandTowards(d0, 1.25D, d1), ENTITY)) {
- if (entity != user) {
- entity.hurt(DamageSource.mobAttack(user), this.getAttackDamage() / 2);
- this.launch(entity, user);
- }
- }
- }
- }
- public void spawnParticles(LivingEntity entity) {
- Random offset = new Random();
- Vector3d vector3d = entity.getBoundingBox().getCenter();
- Vector3d look = entity.getLookAngle();
- for (int i = 0; i < 40; ++i) {
- double d0 = (look.x() * this.getStrength()) * 1.5D;
- double d1 = (look.z() * this.getStrength()) * 1.5D;
- entity.level.addParticle(this.getSlamParticle(), vector3d.x, vector3d.y, vector3d.z, d0 * offset.nextDouble(), 0, d1 * offset.nextDouble());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement