Skip to content

Textures - Flipbook Textures

anvil.api.textures.flipbook

The resource pack's textures/flipbook_textures.json: animated block textures.

FlipBookTexturesObject

Bases: JsonFile[_FlipbookTexturesFile]

The animated block textures, textures/flipbook_textures.json. There is one per pack.

Documentation reference

identifier property

The file's identifier.

name property

The identifier's name, without its namespace.

__export__()

Writes the flipbook textures, when there is any.

__init__()

Initializes a FlipBookTexturesObject instance.

__new__()

Ensures only one instance of FlipBookTexturesObject exists (singleton pattern).

__schema__() classmethod

The JSON Schema (draft 2020-12) of this file: the schema of its _document_type, with the file's type as title and where it is written under x-anvil-file.

Raises:

Type Description
TypeError

When the class is an abstract file base, with no document type.

add_block(block_name, directory, block_texture, frames, ticks_per_frame=None, atlas_index=None, atlas_tile_variant=None, replicate=1, blend_frames=True)

Animates a block texture. The texture file is a vertical strip of frames.

Parameters:

Name Type Description Default
block_name str

The short name of the texture in the terrain atlas, <namespace>:<block_name>.

required
directory str

The folder of the texture, inside the project's blocks folder.

required
block_texture str

The texture file name, without extension.

required
frames list[int] | int

The frame shown on each step, or how many frames play one after another.

required
ticks_per_frame int

The ticks each frame shows, 20 ticks being one second. Game default 1.

None
atlas_index int

The texture to animate when the short name has a list of textures.

None
atlas_tile_variant int

The variation to animate when the short name has variations.

None
replicate int

Shows 1 / replicate² of each frame's pixels, a power of two. Defaults to 1.

1
blend_frames bool

Blends one frame into the next. Defaults to True.

True
Documentation reference

queue()

Queues the flipbook textures for export.