dev.polymodloader.api.content.entity
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
AiGoal | 인터페이스 | One behaviour of a mod mob, run by the game's goal scheduler on the server thread: every tick the scheduler starts the best-priority goals that canStart and whose controls are free, ticks running goals, and stops those that no longer shouldContinue. |
EntityBehavior | 인터페이스 | Code that runs for a mod mob. |
EntityDefinition | 레코드 | A mod mob: a pathfinding creature with the game's standard AI goals, drawn with the humanoid (player-shaped) model and a 64×64 skin-layout texture, or with its own box model(). |
EntityDefinition.Builder | 클래스 | Builds an EntityDefinition. |
EntityDefinition.GoalEntry | 레코드 | An extra AI goal. |
EntityDefinition.Movement | 열거형 | How a mob moves and finds paths. |
EntityDefinition.Riding | 열거형 | How players ride a mob. |
EntityHandle | 인터페이스 | A declared entity type. |
EntityInteraction | 레코드 | A player using (right-clicking) a mod mob. |
GoalControl | 열거형 | What an AiGoal controls. |
MobCategory | 열거형 | Spawn group of a mob, which decides despawning and difficulty rules like the game's categories. |
NaturalSpawn | 레코드 | Where and how often a mob spawns by itself. |
ProjectileBehavior | 인터페이스 | Code that runs when a mod projectile hits something; on the server thread. |
ProjectileDefinition | 레코드 | A thrown projectile such as a snowball: it flies, falls with gravity, and on its first hit deals damage, calls the behaviour, and disappears. |
ProjectileDefinition.Builder | 클래스 | Builds a ProjectileDefinition. |
ProjectileHit | 레코드 | What a projectile hit. |
AiGoal
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface AiGoal
One behaviour of a mod mob, run by the game's goal scheduler on the server thread: every tick the scheduler starts the best-priority goals that canStart and whose controls are free, ticks running goals, and stops those that no longer shouldContinue. Each mob gets its own goal object from the factory given to EntityDefinition.Builder.goal, so goals may keep state in fields.
controls()
default Set<GoalControl> controls()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The controls this goal needs while it runs; default GoalControl.MOVE.
반환 Set<GoalControl>
canStart(MobView)
boolean canStart(MobView mob)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Whether the goal should start now. Called often; keep it cheap.
| 인자 | 타입 | 설명 |
|---|---|---|
mob | MobView | — |
반환 boolean
shouldContinue(MobView)
default boolean shouldContinue(MobView mob)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Whether a running goal keeps running; default canStart.
| 인자 | 타입 | 설명 |
|---|---|---|
mob | MobView | — |
반환 boolean
start(MobView)
default void start(MobView mob)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The goal started.
| 인자 | 타입 | 설명 |
|---|---|---|
mob | MobView | — |
tick(MobView)
default void tick(MobView mob)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Every tick while running.
| 인자 | 타입 | 설명 |
|---|---|---|
mob | MobView | — |
stop(MobView)
default void stop(MobView mob)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The goal stopped or was interrupted.
| 인자 | 타입 | 설명 |
|---|---|---|
mob | MobView | — |
EntityBehavior
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface EntityBehavior
Code that runs for a mod mob. Defaults keep the game's behaviour.
onServerTick(LivingEntityView)
default void onServerTick(LivingEntityView entity)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Every server tick while the mob is alive. Keep it cheap.
| 인자 | 타입 | 설명 |
|---|---|---|
entity | LivingEntityView | — |
onInteract(EntityInteraction)
default InteractionResult onInteract(EntityInteraction interaction)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A player used the mob (both sides; check world().isClientSide()).
| 인자 | 타입 | 설명 |
|---|---|---|
interaction | EntityInteraction | — |
반환 InteractionResult
EntityDefinition
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record EntityDefinition(float width, float height, MobCategory category, double maxHealth, double movementSpeed, double attackDamage, boolean wander, boolean lookAtPlayers, boolean panicWhenHurt, boolean attackPlayers, Optional<ResourceId> temptedBy, ResourceId texture, Optional<CreativeTab> spawnEggTab, EntityBehavior behavior, List<NaturalSpawn> naturalSpawns, List<EntityDefinition.GoalEntry> goals, EntityDefinition.Riding riding, boolean noGravity, boolean pushable, Optional<EntityModelDefinition> model, EntityDefinition.Movement movement, double flyingSpeed)
A mod mob: a pathfinding creature with the game's standard AI goals, drawn with the humanoid (player-shaped) model and a 64×64 skin-layout texture, or with its own box model().
| 구성 요소 | 타입 | 설명 |
|---|---|---|
width | float | hitbox width in blocks |
height | float | hitbox height in blocks |
category | MobCategory | spawn group |
maxHealth | double | health in half-hearts |
movementSpeed | double | base speed (zombie 0.23, villager 0.5) |
attackDamage | double | melee damage; used only with attackPlayers() |
wander | boolean | walk around randomly |
lookAtPlayers | boolean | look at nearby players |
panicWhenHurt | boolean | run away when hurt |
attackPlayers | boolean | chase and hit players |
temptedBy | Optional<ResourceId> | follow players holding this item, if set |
texture | ResourceId | skin texture, for example my_mod:textures/entity/golem.png |
spawnEggTab | Optional<CreativeTab> | when present, declares <id>_spawn_egg in this creative tab |
behavior | EntityBehavior | callbacks |
naturalSpawns | List<NaturalSpawn> | where the mob spawns by itself; empty for never |
goals | List<EntityDefinition.GoalEntry> | extra AI goals, each created per mob |
riding | EntityDefinition.Riding | whether and how players ride the mob |
noGravity | boolean | whether the mob floats |
pushable | boolean | whether other entities push the mob |
model | Optional<EntityModelDefinition> | a box model drawn with texture, or empty for the player-shaped model |
movement | EntityDefinition.Movement | how the mob moves and finds paths |
flyingSpeed | double | speed in the air for Movement.FLY (parrot 0.4); ignored otherwise |
builder(ResourceId)
public static EntityDefinition.Builder builder(ResourceId texture)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A builder for a 0.6×1.95 creature (player-sized) with the given skin texture.
| 인자 | 타입 | 설명 |
|---|---|---|
texture | ResourceId | — |
반환 EntityDefinition.Builder
EntityDefinition.Builder
클래스 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static final class Builder
Builds an EntityDefinition.
size(float, float)
public EntityDefinition.Builder size(float width, float height)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Hitbox width and height in blocks.
| 인자 | 타입 | 설명 |
|---|---|---|
width | float | — |
height | float | — |
반환 EntityDefinition.Builder
category(MobCategory)
public EntityDefinition.Builder category(MobCategory category)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Spawn group; MobCategory.CREATURE by default.
| 인자 | 타입 | 설명 |
|---|---|---|
category | MobCategory | — |
반환 EntityDefinition.Builder
maxHealth(double)
public EntityDefinition.Builder maxHealth(double maxHealth)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Health in half-hearts; 20 by default.
| 인자 | 타입 | 설명 |
|---|---|---|
maxHealth | double | — |
반환 EntityDefinition.Builder
movementSpeed(double)
public EntityDefinition.Builder movementSpeed(double movementSpeed)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Base speed (zombie 0.23, villager 0.5); 0.25 by default.
| 인자 | 타입 | 설명 |
|---|---|---|
movementSpeed | double | — |
반환 EntityDefinition.Builder
noWandering()
public EntityDefinition.Builder noWandering()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob stands still.
반환 EntityDefinition.Builder
panicWhenHurt()
public EntityDefinition.Builder panicWhenHurt()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob runs away for a while after being hurt.
반환 EntityDefinition.Builder
attackPlayers(double)
public EntityDefinition.Builder attackPlayers(double damage)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob chases and hits players for damage.
| 인자 | 타입 | 설명 |
|---|---|---|
damage | double | — |
반환 EntityDefinition.Builder
temptedBy(ResourceId)
public EntityDefinition.Builder temptedBy(ResourceId item)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob follows players holding item.
| 인자 | 타입 | 설명 |
|---|---|---|
item | ResourceId | — |
반환 EntityDefinition.Builder
spawnEgg(CreativeTab)
public EntityDefinition.Builder spawnEgg(CreativeTab tab)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Declares a spawn egg item <id>_spawn_egg listed in tab.
| 인자 | 타입 | 설명 |
|---|---|---|
tab | CreativeTab | — |
반환 EntityDefinition.Builder
behavior(EntityBehavior)
public EntityDefinition.Builder behavior(EntityBehavior behavior)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Callbacks for ticks and interaction.
| 인자 | 타입 | 설명 |
|---|---|---|
behavior | EntityBehavior | — |
반환 EntityDefinition.Builder
spawnsNaturally(BiomeSelector, int, int, int)
public EntityDefinition.Builder spawnsNaturally(BiomeSelector biomes, int weight, int minGroup, int maxGroup)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob spawns by itself in biomes, in groups of minGroup..maxGroup.
| 인자 | 타입 | 설명 |
|---|---|---|
biomes | BiomeSelector | — |
weight | int | — |
minGroup | int | — |
maxGroup | int | — |
반환 EntityDefinition.Builder
goal(int, Supplier<AiGoal>)
public EntityDefinition.Builder goal(int priority, Supplier<AiGoal> factory)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds an AI goal created for each mob by factory.
| 인자 | 타입 | 설명 |
|---|---|---|
priority | int | — |
factory | Supplier<AiGoal> | — |
반환 EntityDefinition.Builder
targetGoal(int, Supplier<AiGoal>)
public EntityDefinition.Builder targetGoal(int priority, Supplier<AiGoal> factory)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a target goal (chooses whom to attack) created for each mob by factory.
| 인자 | 타입 | 설명 |
|---|---|---|
priority | int | — |
factory | Supplier<AiGoal> | — |
반환 EntityDefinition.Builder
rideable(boolean)
public EntityDefinition.Builder rideable(boolean steerable)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Players can ride the mob; with steerable they also steer it.
| 인자 | 타입 | 설명 |
|---|---|---|
steerable | boolean | — |
반환 EntityDefinition.Builder
noGravity()
public EntityDefinition.Builder noGravity()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob is not pulled down by gravity.
반환 EntityDefinition.Builder
notPushable()
public EntityDefinition.Builder notPushable()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Other entities do not push the mob.
반환 EntityDefinition.Builder
model(EntityModelDefinition)
public EntityDefinition.Builder model(EntityModelDefinition model)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Draws the mob with a box model instead of the player-shaped one.
| 인자 | 타입 | 설명 |
|---|---|---|
model | EntityModelDefinition | — |
반환 EntityDefinition.Builder
flying(double)
public EntityDefinition.Builder flying(double flyingSpeed)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob flies and hovers (Movement.FLY) at flyingSpeed (parrot 0.4) in the air; movementSpeed still applies on the ground.
| 인자 | 타입 | 설명 |
|---|---|---|
flyingSpeed | double | — |
반환 EntityDefinition.Builder
swimming()
public EntityDefinition.Builder swimming()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The mob swims under water (Movement.SWIM) at movementSpeed.
반환 EntityDefinition.Builder
build()
public EntityDefinition build()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Creates the definition; invalid values throw IllegalArgumentException.
반환 EntityDefinition
EntityDefinition.GoalEntry
레코드 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static record GoalEntry(int priority, Supplier<AiGoal> factory, boolean target)
An extra AI goal.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
priority | int | lower runs first; the built-in goals use 0 (float), 1 (panic), 2 (attack), 3 (tempt), 5 (wander), 6–7 (look around) |
factory | Supplier<AiGoal> | creates the goal for each mob |
target | boolean | whether it is a target goal (chooses whom to attack) rather than a behaviour goal |
EntityDefinition.Movement
열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static enum Movement
How a mob moves and finds paths.
| 상수 | 설명 |
|---|---|
WALK | Walks and jumps; swims to the surface in water. |
FLY | Flies in any direction and hovers when it stops, like a bee; takes no fall damage. Paths go through the air. |
SWIM | Swims in any direction under water, like a dolphin, and breathes there; paths stay in water. Out of water it only crawls slowly. Use MobCategory.WATER_CREATURE to spawn it in water. |
EntityDefinition.Riding
열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static enum Riding
How players ride a mob.
| 상수 | 설명 |
|---|---|
NONE | Not at all. |
PASSENGER | Players climb on by using the mob with an empty hand and are carried along. |
STEERABLE | Like PASSENGER, and the rider steers with the movement keys, like a horse. |
EntityHandle
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface EntityHandle extends ContentHandle
A declared entity type.
상위 형식: ContentHandle
EntityInteraction
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record EntityInteraction(WorldView world, LivingEntityView entity, PlayerView player)
A player using (right-clicking) a mod mob.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
world | WorldView | the world, client or server copy |
entity | LivingEntityView | the mob |
player | PlayerView | the player |
GoalControl
열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public enum GoalControl
What an AiGoal controls. Two running goals never share a control; a goal with a better (lower) priority takes it from a worse one.
| 상수 | 설명 |
|---|---|
MOVE | Walking and pathfinding. |
LOOK | Where the head looks. |
JUMP | Jumping. |
TARGET | Choosing an attack target (target goals). |
MobCategory
열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public enum MobCategory
Spawn group of a mob, which decides despawning and difficulty rules like the game's categories.
| 상수 | 설명 |
|---|---|
CREATURE | Peaceful animals; persistent. |
MONSTER | Hostile mobs; removed on peaceful difficulty and despawn far from players. |
AMBIENT | Ambient creatures such as bats. |
WATER_CREATURE | Water animals. |
NaturalSpawn
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record NaturalSpawn(BiomeSelector biomes, int weight, int minGroup, int maxGroup)
Where and how often a mob spawns by itself. Creatures spawn on #minecraft:animals_spawnable_on blocks in daylight, monsters in the dark, water creatures in water, like the game's mobs of the same category.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
biomes | BiomeSelector | where |
weight | int | chance relative to the biome's other mobs of the category (pig 10, zombie 100) |
minGroup | int | smallest group |
maxGroup | int | largest group |
ProjectileBehavior
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface ProjectileBehavior
Code that runs when a mod projectile hits something; on the server thread.
onHitEntity(ProjectileHit)
default void onHitEntity(ProjectileHit hit)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The projectile hit an entity, after its damage was dealt.
| 인자 | 타입 | 설명 |
|---|---|---|
hit | ProjectileHit | — |
onHitBlock(ProjectileHit)
default void onHitBlock(ProjectileHit hit)
추가된 버전 0.1.0-alpha.4 또는 그 이전
The projectile hit a block.
| 인자 | 타입 | 설명 |
|---|---|---|
hit | ProjectileHit | — |
ProjectileDefinition
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record ProjectileDefinition(ResourceId item, float size, double gravity, float damage, ProjectileBehavior behavior)
A thrown projectile such as a snowball: it flies, falls with gravity, and on its first hit deals damage, calls the behaviour, and disappears. Clients draw it as the item. Launch it with LivingEntityView.launchProjectile.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
item | ResourceId | item drawn in flight |
size | float | hitbox width and height in blocks |
gravity | double | downward acceleration per tick (snowball 0.03) |
damage | float | damage to a hit entity, 0 for none |
behavior | ProjectileBehavior | hit callbacks |
builder(ResourceId)
public static ProjectileDefinition.Builder builder(ResourceId item)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A builder for a 0.25-block projectile drawn as item, with snowball gravity and no damage.
| 인자 | 타입 | 설명 |
|---|---|---|
item | ResourceId | — |
반환 ProjectileDefinition.Builder
ProjectileDefinition.Builder
클래스 · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public static final class Builder
Builds a ProjectileDefinition.
size(float)
public ProjectileDefinition.Builder size(float size)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Hitbox width and height in blocks.
| 인자 | 타입 | 설명 |
|---|---|---|
size | float | — |
반환 ProjectileDefinition.Builder
gravity(double)
public ProjectileDefinition.Builder gravity(double gravity)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Downward acceleration per tick (snowball 0.03).
| 인자 | 타입 | 설명 |
|---|---|---|
gravity | double | — |
반환 ProjectileDefinition.Builder
damage(float)
public ProjectileDefinition.Builder damage(float damage)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Damage to a hit entity, 0 for none.
| 인자 | 타입 | 설명 |
|---|---|---|
damage | float | — |
반환 ProjectileDefinition.Builder
behavior(ProjectileBehavior)
public ProjectileDefinition.Builder behavior(ProjectileBehavior behavior)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Callbacks for hitting blocks and entities.
| 인자 | 타입 | 설명 |
|---|---|---|
behavior | ProjectileBehavior | — |
반환 ProjectileDefinition.Builder
build()
public ProjectileDefinition build()
추가된 버전 0.1.0-alpha.4 또는 그 이전
Creates the definition; invalid values throw IllegalArgumentException.
반환 ProjectileDefinition
ProjectileHit
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record ProjectileHit(WorldView world, EntityView projectile, Optional<EntityView> owner, Optional<EntityView> entity, Optional<BlockPos> block)
What a projectile hit.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
world | WorldView | the server world |
projectile | EntityView | the projectile, removed after the callback |
owner | Optional<EntityView> | who launched it, if known |
entity | Optional<EntityView> | the hit entity, for entity hits |
block | Optional<BlockPos> | the hit block, for block hits |