ProjectileImpactArrow
Link to projectileimpactarrow
This event is fired whenever an arrow projectile impacts an entity but before damage, etc, is calculated. It is cancelable, and if canceled, the impact will not be processed.
Various values from the arrow entity are available through zengetters, and can be modified in order to adjust damage, knockback strength, pickup status, and determine (or force) a critical hit.
导入类
Link to 导入类
It might be required to import the class to avoid errors.
import crafttweaker.event.ProjectileImpactArrowEvent;
Extending IEntityEvent
Link to extending-ientityevent
ProjectileImpactArrow Events implement the following interfaces and are able to call all of their methods/getters/setters as well:
ZenGetters and ZenSetters
Link to zengetters-and-zensetters
The following information can be retrieved from the event:
ZenGetter | ZenSetter | 类型 |
---|---|---|
ZenGetter arrow | ZenSetter | 类型 IEntity |
ZenGetter shooter | ZenSetter | 类型 IEntity |
ZenGetter damage | ZenSetter damage | 类型 double |
ZenGetter | ZenSetter knockbackStrength | 类型 int (setter only, no getter) |
ZenGetter isCritical | ZenSetter isCritical | 类型 布尔值 |
ZenGetter pickupStatus | ZenSetter | 类型 字符串[string] |
Additional methods
Link to additional-methods
setPickupDisallowed()
Prevents the arrow from being picked up under any circumstances.
setPickupAllowed()
Allows the arrow to be picked up from where the entity landed.
setPickupCreative()
Only allows the arrow to be picked up if the player is in creative mode.