-
Notifications
You must be signed in to change notification settings - Fork 17
/
HellforkEntity.java
41 lines (34 loc) · 1.23 KB
/
HellforkEntity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package ladysnake.impaled.common.entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.world.World;
import net.minecraft.world.event.GameEvent;
public class HellforkEntity extends ImpaledTridentEntity {
public HellforkEntity(EntityType<? extends HellforkEntity> entityType, World world) {
super(entityType, world);
}
@Override
protected void onHit(LivingEntity target) {
super.onHit(target);
target.setOnFireFor(8);
}
@Override
public boolean isOnFire() {
return true;
}
@Override
public boolean doesRenderOnFire() {
return false;
}
@Override
public void tick() {
super.tick();
if (this.isSubmergedInWater() && this.world.isClient() && this.random.nextInt(5) == 0) {
this.world.addParticle(ParticleTypes.BUBBLE_COLUMN_UP, this.getX() + random.nextGaussian() / 10, this.getY() + random.nextGaussian() / 10, this.getZ() + random.nextGaussian() / 10, 0, this.random.nextFloat(), 0);
}
}
}