dev.polymodloader.api.event.entity
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
AllowDamageListener | 함수형 인터페이스 | Listener for EntityEvents.ALLOW_DAMAGE. |
DamageModifier | 함수형 인터페이스 | Listener for EntityEvents.MODIFY_DAMAGE. |
DeathListener | 함수형 인터페이스 | Listener for EntityEvents.DIED. |
EntityEvents | 클래스 | Entity events, fired on the server thread. |
EntityJoinedWorldListener | 함수형 인터페이스 | Listener for EntityEvents.JOINED_WORLD. |
AllowDamageListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface AllowDamageListener
Listener for EntityEvents.ALLOW_DAMAGE.
allowDamage(LivingEntityView, DamageInfo)
boolean allowDamage(LivingEntityView entity, DamageInfo damage)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Returns false to cancel the damage. Called on the server thread before armour applies.
| 인자 | 타입 | 설명 |
|---|---|---|
entity | LivingEntityView | — |
damage | DamageInfo | — |
반환 boolean
DamageModifier
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface DamageModifier
Listener for EntityEvents.MODIFY_DAMAGE.
modifyDamage(LivingEntityView, DamageInfo)
float modifyDamage(LivingEntityView entity, DamageInfo damage)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Returns the damage to deal instead of damage.amount(); return it unchanged to keep it. Listeners run in registration order and each sees the previous result. A result of 0 or less cancels the damage.
| 인자 | 타입 | 설명 |
|---|---|---|
entity | LivingEntityView | — |
damage | DamageInfo | — |
반환 float
DeathListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface DeathListener
Listener for EntityEvents.DIED.
onDied(LivingEntityView, DamageInfo)
void onDied(LivingEntityView entity, DamageInfo cause)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread when death starts, before drops.
| 인자 | 타입 | 설명 |
|---|---|---|
entity | LivingEntityView | — |
cause | DamageInfo | — |
EntityEvents
클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public final class EntityEvents
Entity events, fired on the server thread.
| 상수·필드 | 타입 | 설명 |
|---|---|---|
JOINED_WORLD | EventKey<EntityJoinedWorldListener> | An entity of any kind joins a server world: spawned, loaded with its chunk, or arriving from another dimension. Fabric API: ServerEntityEvents.ENTITY_LOAD; NeoForge: EntityJoinLevelEvent (not cancellable here). |
ALLOW_DAMAGE | EventKey<AllowDamageListener> | A living entity is about to take damage; any listener returning false cancels it. |
MODIFY_DAMAGE | EventKey<DamageModifier> | A living entity is about to take damage that no ALLOW_DAMAGE listener cancelled; listeners may change the amount. Armour and resistance apply to the result. |
DIED | EventKey<DeathListener> | A living entity died. |
EntityJoinedWorldListener
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface EntityJoinedWorldListener
Listener for EntityEvents.JOINED_WORLD.
onEntityJoinedWorld(EntityView, WorldView)
void onEntityJoinedWorld(EntityView entity, WorldView world)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Called on the server thread while the world starts tracking the entity. Do not remove or move the entity from the listener; schedule such changes with WorldView.schedule. Keep it cheap: chunks full of entities load often.
| 인자 | 타입 | 설명 |
|---|---|---|
entity | EntityView | the entity, of any kind (players, mobs, items, projectiles); valid only during the call |
world | WorldView | its world |