본문으로 건너뛰기
버전: Minecraft 26.2

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.

인자타입설명
entityLivingEntityView—
damageDamageInfo—

반환 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.

인자타입설명
entityLivingEntityView—
damageDamageInfo—

반환 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.

인자타입설명
entityLivingEntityView—
causeDamageInfo—

EntityEvents​

클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public final class EntityEvents

Entity events, fired on the server thread.

상수·필드타입설명
JOINED_WORLDEventKey<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_DAMAGEEventKey<AllowDamageListener>A living entity is about to take damage; any listener returning false cancels it.
MODIFY_DAMAGEEventKey<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.
DIEDEventKey<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.

인자타입설명
entityEntityViewthe entity, of any kind (players, mobs, items, projectiles); valid only during the call
worldWorldViewits world
Buy me a coffee