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

dev.polymodloader.api.content.entity.model

자동 생성

이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.

형식종류설명
EntityModelDefinition레코드A box model for a mod mob, in the game's model space: units are pixels (1/16 block), y grows downwards, and a root part with pivot y 24 stands on the ground.
EntityModelDefinition.Builder클래스Builds an EntityModelDefinition.
KeyframeAnimation레코드A keyframe animation of a mob's box model, like Blockbench's animations: per part and channel, values at points in time, blended in between.
KeyframeAnimation.Builder클래스Builds a KeyframeAnimation.
KeyframeAnimation.Channel레코드The keyframes of one part and target, in time order.
KeyframeAnimation.Interpolation열거형How values are blended between two keyframes.
KeyframeAnimation.Keyframe레코드A value at a point in time.
KeyframeAnimation.Target열거형What a channel changes.
KeyframeAnimation.Trigger열거형When an animation plays.
ModelBox레코드A textured cuboid of a model part, in model pixels (1/16 block) relative to the part's pivot.
ModelPartDefinition레코드A named part of an entity model: boxes around a pivot, an optional parent part, a rest rotation in degrees, and an animation.
ModelPartDefinition.Builder클래스Builds a ModelPartDefinition.
PartAnimation열거형How a model part moves on its own while the mob is drawn.

EntityModelDefinition​

레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public record EntityModelDefinition(int textureWidth, int textureHeight, List<ModelPartDefinition> parts, Map<String,KeyframeAnimation> animations)

A box model for a mod mob, in the game's model space: units are pixels (1/16 block), y grows downwards, and a root part with pivot y 24 stands on the ground. This is the layout that Blockbench's "Modded Entity" projects use. The texture is the mob's texture with textureWidth × textureHeight pixels.

구성 요소타입설명
textureWidthinttexture width in pixels
textureHeightinttexture height in pixels
partsList<ModelPartDefinition>the parts; parents come before their children
animationsMap<String,KeyframeAnimation>keyframe animations by name ([a-z0-9_]+), in declaration order
상수·필드타입설명
MAX_ON_DEMAND_ANIMATIONSintAt most this many KeyframeAnimation.Trigger.ON_DEMAND animations per model.

onDemandAnimations()​

public List<String> onDemandAnimations()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Names of the KeyframeAnimation.Trigger.ON_DEMAND animations, in declaration order.

반환 List<String>

builder(int, int)​

public static EntityModelDefinition.Builder builder(int textureWidth, int textureHeight)

추가된 버전 0.1.0-alpha.4 또는 그 이전

A builder for a model using a textureWidth × textureHeight texture.

인자타입설명
textureWidthint—
textureHeightint—

반환 EntityModelDefinition.Builder

EntityModelDefinition.Builder​

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

public static final class Builder

Builds an EntityModelDefinition.

part(String, Consumer<ModelPartDefinition.Builder>)​

public EntityModelDefinition.Builder part(String name, Consumer<ModelPartDefinition.Builder> part)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Adds a part configured by part.

인자타입설명
nameString—
partConsumer<ModelPartDefinition.Builder>—

반환 EntityModelDefinition.Builder

animation(String, KeyframeAnimation)​

public EntityModelDefinition.Builder animation(String name, KeyframeAnimation animation)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Adds a keyframe animation called name; KeyframeAnimation.Trigger.ON_DEMAND ones are started by name with MobView.playAnimation.

인자타입설명
nameString—
animationKeyframeAnimation—

반환 EntityModelDefinition.Builder

build()​

public EntityModelDefinition build()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Creates the model; invalid parts throw IllegalArgumentException.

반환 EntityModelDefinition

KeyframeAnimation​

레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public record KeyframeAnimation(float lengthSeconds, boolean looping, KeyframeAnimation.Trigger trigger, List<KeyframeAnimation.Channel> channels)

A keyframe animation of a mob's box model, like Blockbench's animations: per part and channel, values at points in time, blended in between. The values are added to the part's rest pose.

구성 요소타입설명
lengthSecondsfloatlength in seconds
loopingbooleanwhether it starts over at the end; otherwise an Trigger.ON_DEMAND animation ends there and the others hold their last keyframe
triggerKeyframeAnimation.Triggerwhen it plays
channelsList<KeyframeAnimation.Channel>the animated values; at most one channel per part and target

builder(float)​

public static KeyframeAnimation.Builder builder(float lengthSeconds)

추가된 버전 0.1.0-alpha.4 또는 그 이전

A builder for an animation lengthSeconds long that plays when the server starts it.

인자타입설명
lengthSecondsfloat—

반환 KeyframeAnimation.Builder

KeyframeAnimation.Builder​

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

public static final class Builder

Builds a KeyframeAnimation.

looping()​

public KeyframeAnimation.Builder looping()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Starts over at the end.

반환 KeyframeAnimation.Builder

trigger(KeyframeAnimation.Trigger)​

public KeyframeAnimation.Builder trigger(KeyframeAnimation.Trigger trigger)

추가된 버전 0.1.0-alpha.4 또는 그 이전

When the animation plays; Trigger.ON_DEMAND by default.

인자타입설명
triggerKeyframeAnimation.Trigger—

반환 KeyframeAnimation.Builder

smooth()​

public KeyframeAnimation.Builder smooth()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Blends the keyframes added after this call along smooth curves instead of straight lines.

반환 KeyframeAnimation.Builder

rotation(String, float, float, float, float)​

public KeyframeAnimation.Builder rotation(String part, float time, float x, float y, float z)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Rotates part by x, y, z degrees at time seconds.

인자타입설명
partString—
timefloat—
xfloat—
yfloat—
zfloat—

반환 KeyframeAnimation.Builder

position(String, float, float, float, float)​

public KeyframeAnimation.Builder position(String part, float time, float x, float y, float z)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Moves part by x, y, z model pixels (y up) at time seconds.

인자타입설명
partString—
timefloat—
xfloat—
yfloat—
zfloat—

반환 KeyframeAnimation.Builder

scale(String, float, float, float, float)​

public KeyframeAnimation.Builder scale(String part, float time, float x, float y, float z)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Scales part by x, y, z (1 keeps the size) at time seconds.

인자타입설명
partString—
timefloat—
xfloat—
yfloat—
zfloat—

반환 KeyframeAnimation.Builder

keyframe(String, KeyframeAnimation.Target, float, float, float, float, KeyframeAnimation.Interpolation)​

public KeyframeAnimation.Builder keyframe(String part, KeyframeAnimation.Target target, float time, float x, float y, float z, KeyframeAnimation.Interpolation interpolation)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Adds a keyframe with every detail given.

인자타입설명
partString—
targetKeyframeAnimation.Target—
timefloat—
xfloat—
yfloat—
zfloat—
interpolationKeyframeAnimation.Interpolation—

반환 KeyframeAnimation.Builder

build()​

public KeyframeAnimation build()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Creates the animation; invalid values throw IllegalArgumentException.

반환 KeyframeAnimation

KeyframeAnimation.Channel​

레코드 · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public static record Channel(String part, KeyframeAnimation.Target target, List<KeyframeAnimation.Keyframe> keyframes)

The keyframes of one part and target, in time order.

구성 요소타입설명
partStringmodel part name
targetKeyframeAnimation.Targetwhat the keyframes change
keyframesList<KeyframeAnimation.Keyframe>the keyframes, sorted by time

KeyframeAnimation.Interpolation​

열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public static enum Interpolation

How values are blended between two keyframes.

상수설명
LINEARIn a straight line.
SMOOTHAlong a smooth curve through the neighbouring keyframes (Catmull-Rom).

KeyframeAnimation.Keyframe​

레코드 · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public static record Keyframe(float time, float x, float y, float z, KeyframeAnimation.Interpolation interpolation)

A value at a point in time.

구성 요소타입설명
timefloatseconds from the start, 0..lengthSeconds
xfloatvalue for x
yfloatvalue for y
zfloatvalue for z
interpolationKeyframeAnimation.Interpolationhow the value is reached from the previous keyframe

KeyframeAnimation.Target​

열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public static enum Target

What a channel changes.

상수설명
ROTATIONRotation in degrees around x, y and z.
POSITIONOffset in model pixels; y grows upwards, as in Blockbench.
SCALESize factor per axis; 1 keeps the size.

KeyframeAnimation.Trigger​

열거형 · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public static enum Trigger

When an animation plays.

상수설명
ALWAYSAll the time, from when the mob appears; usually looping (idle breathing, a spinning part).
WHILE_MOVINGWhile the mob moves, faster the faster it moves; usually looping (walk cycle, wing beats).
ON_DEMANDWhen the server starts it with MobView.playAnimation; every client that sees the mob plays it from the start (attack, wave).

ModelBox​

레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public record ModelBox(int u, int v, float x, float y, float z, float width, float height, float depth, boolean mirror)

A textured cuboid of a model part, in model pixels (1/16 block) relative to the part's pivot.

구성 요소타입설명
uinttexture x of the box's net (the game's cube unwrap layout)
vinttexture y of the box's net
xfloatlowest corner x
yfloatlowest corner y (y grows downwards in models)
zfloatlowest corner z
widthfloatsize along x
heightfloatsize along y
depthfloatsize along z
mirrorbooleanmirrors the texture horizontally

ModelPartDefinition​

레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public record ModelPartDefinition(String name, Optional<String> parent, float pivotX, float pivotY, float pivotZ, float rotationX, float rotationY, float rotationZ, List<ModelBox> boxes, PartAnimation animation)

A named part of an entity model: boxes around a pivot, an optional parent part, a rest rotation in degrees, and an animation.

구성 요소타입설명
nameStringpart name, unique in the model
parentOptional<String>parent part, or empty for the root
pivotXfloatpivot x relative to the parent's pivot (model pixels)
pivotYfloatpivot y (24 is the ground for root parts, y grows downwards)
pivotZfloatpivot z
rotationXfloatrest rotation around x, degrees
rotationYfloatrest rotation around y, degrees
rotationZfloatrest rotation around z, degrees
boxesList<ModelBox>the part's cuboids
animationPartAnimationhow it moves

ModelPartDefinition.Builder​

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

public static final class Builder

Builds a ModelPartDefinition.

parent(String)​

public ModelPartDefinition.Builder parent(String parent)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Attaches the part to parent; its pivot becomes relative to the parent's.

인자타입설명
parentString—

반환 ModelPartDefinition.Builder

pivot(float, float, float)​

public ModelPartDefinition.Builder pivot(float x, float y, float z)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The point the part turns around, relative to the parent's pivot (model pixels, y down).

인자타입설명
xfloat—
yfloat—
zfloat—

반환 ModelPartDefinition.Builder

rotation(float, float, float)​

public ModelPartDefinition.Builder rotation(float x, float y, float z)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Rest rotation in degrees.

인자타입설명
xfloat—
yfloat—
zfloat—

반환 ModelPartDefinition.Builder

box(int, int, float, float, float, float, float, float)​

public ModelPartDefinition.Builder box(int u, int v, float x, float y, float z, float width, float height, float depth)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Adds a box whose texture net starts at u, v.

인자타입설명
uint—
vint—
xfloat—
yfloat—
zfloat—
widthfloat—
heightfloat—
depthfloat—

반환 ModelPartDefinition.Builder

mirroredBox(int, int, float, float, float, float, float, float)​

public ModelPartDefinition.Builder mirroredBox(int u, int v, float x, float y, float z, float width, float height, float depth)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Adds a box with a mirrored texture.

인자타입설명
uint—
vint—
xfloat—
yfloat—
zfloat—
widthfloat—
heightfloat—
depthfloat—

반환 ModelPartDefinition.Builder

animation(PartAnimation)​

public ModelPartDefinition.Builder animation(PartAnimation animation)

추가된 버전 0.1.0-alpha.4 또는 그 이전

How the part moves on its own; PartAnimation.NONE by default.

인자타입설명
animationPartAnimation—

반환 ModelPartDefinition.Builder

PartAnimation​

열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public enum PartAnimation

How a model part moves on its own while the mob is drawn.

상수설명
NONEKeeps its pose.
HEADTurns with the mob's head (look direction).
WALK_SWINGSwings forward and back while walking (a leg or arm).
WALK_SWING_OPPOSITESwings opposite to WALK_SWING.
BOBMoves gently up and down all the time.
SPINSpins around its vertical axis all the time.
Buy me a coffee