类 CriticalHitEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.player.PlayerEvent
net.minecraftforge.event.entity.player.CriticalHitEvent
This event is fired whenever a player attacks an Entity in
EntityPlayer#attackTargetEntityWithCurrentItem(Entity).
This event is not
This event has a result.
DEFAULT: means the vanilla logic will determine if this a critical hit.
DENY: it will not be a critical hit but the player still will attack
ALLOW: this attack is forced to be critical
This event is fired on the
This event is not
Cancelable
.This event has a result.
Event.HasResult
DEFAULT: means the vanilla logic will determine if this a critical hit.
DENY: it will not be a critical hit but the player still will attack
ALLOW: this attack is forced to be critical
This event is fired on the
MinecraftForge.EVENT_BUS
.-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat
从类继承的嵌套类/接口 net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器构造器说明CriticalHitEvent
(Player player, Entity target, float damageModifier, boolean vanillaCritical) -
方法概要
修饰符和类型方法说明float
The damage modifier for the hit.
This is by default 1.5F for ciritcal hits and 1F for normal hits .float
The orignal damage modifier for the hit wthout any changes.
This is 1.5F for ciritcal hits and 1F for normal hits .The Entity that was damaged by the player.boolean
Returns true if this hit was critical by vanillavoid
setDamageModifier
(float mod) This set the damage multiplier for the hit.从类继承的方法 net.minecraftforge.event.entity.player.PlayerEvent
getEntity
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
damageModifier
private float damageModifier -
oldDamageModifier
private final float oldDamageModifier -
target
-
vanillaCritical
private final boolean vanillaCritical
-
-
构造器详细资料
-
CriticalHitEvent
-
-
方法详细资料
-
getTarget
The Entity that was damaged by the player. -
setDamageModifier
public void setDamageModifier(float mod) This set the damage multiplier for the hit. If you set it to 0, then the particles are still generated but damage is not done. -
getDamageModifier
public float getDamageModifier()The damage modifier for the hit.
This is by default 1.5F for ciritcal hits and 1F for normal hits . -
getOldDamageModifier
public float getOldDamageModifier()The orignal damage modifier for the hit wthout any changes.
This is 1.5F for ciritcal hits and 1F for normal hits . -
isVanillaCritical
public boolean isVanillaCritical()Returns true if this hit was critical by vanilla
-