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

dev.polymodloader.api.content

자동 생성

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

형식종류설명
AdvancementTrigger인터페이스A criterion trigger for advancements in data packs: an advancement criterion with "trigger": "<mod id>:<path>" is met when the mod calls trigger.
ContentHandle인터페이스A declared piece of content.
ContentRegistrar인터페이스Declares a mod's blocks and items.
CreativeTab열거형The game's creative inventory tabs that mod items can be listed in.
CreativeTabDefinition레코드A mod's own creative inventory tab, declared with ContentRegistrar.creativeTab.
CreativeTabDefinition.Builder클래스Builds a CreativeTabDefinition.
EntityDataKey레코드Mod data attached to entities (players included): a DataTree per entity, saved with it, kept by players when they respawn, and synchronised to clients as the EntityDataOptions say.
EntityDataOptions레코드How an EntityDataKey is kept and shared.
SoundHandle인터페이스A declared sound event.

AdvancementTrigger​

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

public interface AdvancementTrigger

A criterion trigger for advancements in data packs: an advancement criterion with "trigger": "<mod id>:<path>" is met when the mod calls trigger.

id()​

ResourceId id()

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

The trigger ID used in advancement files.

반환 ResourceId

trigger(PlayerView)​

void trigger(PlayerView player)

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

Meets every criterion with this trigger for player.

인자타입설명
playerPlayerView—

예외 IllegalStateException — on the client side

ContentHandle​

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

public interface ContentHandle

A declared piece of content. The game creates it later, when its registries are built.

id()​

ResourceId id()

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

The content's ID, <mod id>:<path>.

반환 ResourceId

isRegistered()​

boolean isRegistered()

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

Whether the game has created and registered the content yet.

반환 boolean

ContentRegistrar​

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

public interface ContentRegistrar

Declares a mod's blocks and items. IDs are <mod id>:<path>.

When: only inside common entrypoints. Poly Mod Loader creates the declared content just before the game freezes its registries; content cannot be added afterwards (POLY-CONTENT-002). Models, textures, translations, recipes, loot tables, and tags come from the mod jar's assets/ and data/ folders, which Poly Mod Loader adds as a required resource and data pack.

Both sides: client and server must declare the same content in the same order, because the game synchronises blocks by number.

block(String, BlockDefinition)​

BlockHandle block(String path, BlockDefinition definition)

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

Declares a block; unless the definition says otherwise, a block item with the same ID is declared too.

인자타입설명
pathString—
definitionBlockDefinition—

반환 BlockHandle

예외 IllegalArgumentException — for an invalid path or a path this mod already used (POLY-CONTENT-001)

예외 IllegalStateException — after registration closed (POLY-CONTENT-002)

item(String, ItemDefinition)​

ItemHandle item(String path, ItemDefinition definition)

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

Declares an item.

인자타입설명
pathString—
definitionItemDefinition—

반환 ItemHandle

예외 IllegalArgumentException — for an invalid path or a path this mod already used (POLY-CONTENT-001)

예외 IllegalStateException — after registration closed (POLY-CONTENT-002)

entity(String, EntityDefinition)​

EntityHandle entity(String path, EntityDefinition definition)

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

Declares a mob type; with spawnEgg also an item <path>_spawn_egg. Mobs are spawned by eggs, commands (/summon), WorldView.spawnEntity, and naturally where the definition says.

인자타입설명
pathString—
definitionEntityDefinition—

반환 EntityHandle

effect(String, EffectDefinition)​

EffectHandle effect(String path, EffectDefinition definition)

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

Declares a status effect usable with /effect and LivingEntityView.addEffect.

인자타입설명
pathString—
definitionEffectDefinition—

반환 EffectHandle

booleanRule(String, boolean, GameRuleCategory)​

GameRuleKey<Boolean> booleanRule(String path, boolean defaultValue, GameRuleCategory category)

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

Declares a boolean game rule.

인자타입설명
pathString—
defaultValueboolean—
categoryGameRuleCategory—

반환 GameRuleKey<Boolean>

integerRule(String, int, int, int, GameRuleCategory)​

GameRuleKey<Integer> integerRule(String path, int defaultValue, int min, int max, GameRuleCategory category)

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

Declares an integer game rule limited to [min, max].

인자타입설명
pathString—
defaultValueint—
minint—
maxint—
categoryGameRuleCategory—

반환 GameRuleKey<Integer>

sound(String)​

SoundHandle sound(String path)

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

Declares a sound event.

인자타입설명
pathString—

반환 SoundHandle

projectile(String, ProjectileDefinition)​

EntityHandle projectile(String path, ProjectileDefinition definition)

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

Declares a thrown projectile type.

인자타입설명
pathString—
definitionProjectileDefinition—

반환 EntityHandle

itemComponent(String, ComponentType<T>)​

<T> ItemComponentKey<T> itemComponent(String path, ComponentType<T> type)

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

Declares a data component that item stacks can carry.

인자타입설명
pathString—
typeComponentType<T>—

반환 ItemComponentKey<T>

예외 IllegalArgumentException — for an invalid or used path (POLY-CONTENT-001)

particle(String, ParticleDefinition)​

ContentHandle particle(String path, ParticleDefinition definition)

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

Declares a particle type, spawnable with WorldView.spawnParticles and /particle.

인자타입설명
pathString—
definitionParticleDefinition—

반환 ContentHandle

entityData(String, boolean)​

default EntityDataKey entityData(String path, boolean syncToOwner)

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

Declares data that entities carry; see EntityDataKey.

인자타입설명
pathString—
syncToOwnerboolean—

반환 EntityDataKey

entityData(String, EntityDataOptions)​

EntityDataKey entityData(String path, EntityDataOptions options)

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

Declares data that entities carry, with synchronisation and version options.

인자타입설명
pathString—
optionsEntityDataOptions—

반환 EntityDataKey

advancementTrigger(String)​

AdvancementTrigger advancementTrigger(String path)

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

Declares an advancement criterion trigger <mod id>:<path>.

인자타입설명
pathString—

반환 AdvancementTrigger

addToTag(TagKey, ResourceId[])​

void addToTag(TagKey tag, ResourceId... entries)

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

Adds entries to a tag of any namespace, as a tag file with "replace": false in the mod jar would; Poly Mod Loader writes them to its generated data pack. Several calls and several mods add up. Entries are checked when the registries freeze: an entry that is not registered then is reported (POLY-CONTENT-007) and left out, the rest of the tag still loads.

인자타입설명
tagTagKey—
entriesResourceId[]block, item, or entity type IDs matching the tag's registry

예외 IllegalArgumentException — for no entries

예외 IllegalStateException — after registration closed (POLY-CONTENT-002)

creativeTab(String, CreativeTabDefinition)​

ContentHandle creativeTab(String path, CreativeTabDefinition definition)

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

Declares a creative inventory tab <mod id>:<path>, titled by the translation of itemGroup.<mod id>.<path>. Entries and icon are checked when the registries freeze: one that is not a registered item then is reported (POLY-CONTENT-008) and left out (a missing icon falls back to the first valid entry).

인자타입설명
pathString—
definitionCreativeTabDefinition—

반환 ContentHandle

예외 IllegalArgumentException — for an invalid or used path (POLY-CONTENT-001)

예외 IllegalStateException — after registration closed (POLY-CONTENT-002)

CreativeTab​

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

public enum CreativeTab

The game's creative inventory tabs that mod items can be listed in. Items are appended at the end.

상수설명
BUILDING_BLOCKS—
COLORED_BLOCKS—
NATURAL_BLOCKS—
FUNCTIONAL_BLOCKS—
REDSTONE_BLOCKS—
TOOLS_AND_UTILITIES—
COMBAT—
FOOD_AND_DRINKS—
INGREDIENTS—
SPAWN_EGGS—

CreativeTabDefinition​

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

public record CreativeTabDefinition(Optional<ResourceId> icon, List<ResourceId> entries)

A mod's own creative inventory tab, declared with ContentRegistrar.creativeTab. Created with builder(); immutable. The tab's title is the translation of itemGroup.<mod id>.<path> from the mod's language files.

The game's creative screen has room for its own tabs only, so Poly Mod Loader puts mod tabs on extra pages (ten per page, in declaration order) and adds page buttons to the screen. Items can still be listed in the game's tabs with CreativeTab.

구성 요소타입설명
iconOptional<ResourceId>item shown on the tab; empty for the first entry
entriesList<ResourceId>items listed in the tab, in this order: mod items or the game's

iconOrFirstEntry()​

public ResourceId iconOrFirstEntry()

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

The icon: the declared one or the first entry.

반환 ResourceId

builder()​

public static CreativeTabDefinition.Builder builder()

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

A builder for a tab without entries yet.

반환 CreativeTabDefinition.Builder

CreativeTabDefinition.Builder​

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

public static final class Builder

Builds a CreativeTabDefinition.

icon(ResourceId)​

public CreativeTabDefinition.Builder icon(ResourceId item)

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

Sets the item shown on the tab.

인자타입설명
itemResourceId—

반환 CreativeTabDefinition.Builder

entry(ResourceId)​

public CreativeTabDefinition.Builder entry(ResourceId item)

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

Adds an item to the end of the tab.

인자타입설명
itemResourceId—

반환 CreativeTabDefinition.Builder

entries(ResourceId[])​

public CreativeTabDefinition.Builder entries(ResourceId... items)

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

Adds items to the end of the tab, in order.

인자타입설명
itemsResourceId[]—

반환 CreativeTabDefinition.Builder

build()​

public CreativeTabDefinition build()

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

Builds the definition.

반환 CreativeTabDefinition

예외 IllegalArgumentException — when no entry was added

EntityDataKey​

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

public record EntityDataKey(ResourceId id, EntityDataOptions options)

Mod data attached to entities (players included): a DataTree per entity, saved with it, kept by players when they respawn, and synchronised to clients as the EntityDataOptions say. Read it with EntityView.data(EntityDataKey).

구성 요소타입설명
idResourceIdkey ID
optionsEntityDataOptionssynchronisation and version

syncToOwner()​

public boolean syncToOwner()

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

Whether a player's own client receives the player's data.

반환 boolean

EntityDataOptions​

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

public record EntityDataOptions(boolean syncToOwner, boolean syncToTrackers, int version, Optional<DataMigration> migration)

How an EntityDataKey is kept and shared.

구성 요소타입설명
syncToOwnerbooleana player's own client receives the player's data
syncToTrackersbooleanevery client that can see the entity receives its data (for drawing or client logic); includes the owner
versionintcurrent data version; data saved with an older one runs migration
migrationOptional<DataMigration>upgrades older data, if any
상수·필드타입설명
DEFAULTEntityDataOptionsSaved only, not synchronised, version 0.

syncedToOwner()​

public EntityDataOptions syncedToOwner()

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

A copy whose data a player's own client receives.

반환 EntityDataOptions

syncedToTrackers()​

public EntityDataOptions syncedToTrackers()

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

A copy whose data every client that can see the entity receives.

반환 EntityDataOptions

withVersion(int, DataMigration)​

public EntityDataOptions withVersion(int value, DataMigration upgrade)

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

A copy with data version value; upgrade converts data saved with an older version.

인자타입설명
valueint—
upgradeDataMigration—

반환 EntityDataOptions

SoundHandle​

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

public interface SoundHandle extends ContentHandle

A declared sound event. Its files are listed in the mod's assets/<mod id>/sounds.json under the same path, as for the game's sounds.

상위 형식: ContentHandle

Buy me a coffee