public class CriticalHitEvent extends PlayerEvent
Cancelable
.Event.HasResult
MinecraftForge.EVENT_BUS
.PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.Visibility
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.EyeHeight
Modifier and Type | Field and Description |
---|---|
private float |
damageModifier |
private float |
oldDamageModifier |
private Entity |
target |
private boolean |
vanillaCritical |
Constructor and Description |
---|
CriticalHitEvent(PlayerEntity player,
Entity target,
float damageModifier,
boolean vanillaCritical) |
Modifier and Type | Method and Description |
---|---|
float |
getDamageModifier()
The damage modifier for the hit.
This is by default 1.5F for ciritcal hits and 1F for normal hits . |
float |
getOldDamageModifier()
The orignal damage modifier for the hit wthout any changes.
This is 1.5F for ciritcal hits and 1F for normal hits . |
Entity |
getTarget()
The Entity that was damaged by the player.
|
boolean |
isVanillaCritical()
Returns true if this hit was critical by vanilla
|
void |
setDamageModifier(float mod)
This set the damage multiplier for the hit.
|
getPlayer
getEntityLiving
getEntity
private float damageModifier
private final float oldDamageModifier
private final Entity target
private final boolean vanillaCritical
public CriticalHitEvent(PlayerEntity player, Entity target, float damageModifier, boolean vanillaCritical)
public Entity getTarget()
public void setDamageModifier(float mod)
public float getDamageModifier()
public float getOldDamageModifier()
public boolean isVanillaCritical()