Skip to content

Migrating from 1.1.4 to 1.1.5

1.1.5 unifies BlockCollisionBox, moves both BlockCollisionBox and BlockSelectionBox to builder methods, namespaces custom entity events and component groups, merges anvil.beta into anvil.api, separates features.preview from build.export_target, and hardens jsonmodel validation. Each breaking change fails loudly at import, construction, or export time.


Block collision boxes

BlockCollisionBox no longer accepts origin or size in its constructor. Add boxes with .add_box(...) instead.

anvil.beta.blocks.components.BlockCollisionBox and BlockMinMaxBox have been removed — anvil.api.blocks.components.BlockCollisionBox now handles both origin/size and beta min/max (as well as set_voxel_shape(...)).

1.1.4 1.1.5
BlockCollisionBox(origin=..., size=...) BlockCollisionBox().add_box(origin=..., size=...)
BlockCollisionBox(origin=..., size=...).add_box(...) BlockCollisionBox().add_box(origin=..., size=...).add_box(...)
anvil.beta.blocks.components.BlockCollisionBox(min=..., max=...) BlockCollisionBox().add_box(min=..., max=...)
anvil.beta.blocks.components.BlockCollisionBox().set_voxel_shape(...) BlockCollisionBox().set_voxel_shape(...)
BlockCollisionBox() / BlockCollisionBox(enabled=False) unchanged
from anvil.api.blocks.components import BlockCollisionBox

# 1.1.4
BlockCollisionBox(origin=(-8, 0, -8), size=(16, 12, 16))

# 1.1.5 (stable)
BlockCollisionBox().add_box(origin=(-8, 0, -8), size=(16, 12, 16))

# 1.1.5 (multiple boxes)
(
    BlockCollisionBox()
    .add_box(origin=(-8, 0, -8), size=(16, 8, 16))
    .add_box(origin=(-4, 8, -4), size=(8, 16, 8))
)

# 1.1.5 (preview min/max or voxel shape — requires features.preview)
BlockCollisionBox().add_box(min=(0, 0, 0), max=(16, 12, 16))
BlockCollisionBox().set_voxel_shape(blockbench="lantern")

Exclusive box formats

origin/size and min/max cannot be mixed on the same BlockCollisionBox. Non-preview builds only allow origin/size; preview builds automatically convert origin/size boxes to min/max with a one-time deprecation warning.


Block selection boxes

BlockSelectionBox no longer accepts origin or size in its constructor. Set the box with .set_box(origin=..., size=...) instead.

1.1.4 1.1.5
BlockSelectionBox(origin=..., size=...) BlockSelectionBox().set_box(origin=..., size=...)
BlockSelectionBox() / BlockSelectionBox(enabled=False) unchanged
from anvil.api.blocks.components import BlockSelectionBox

# 1.1.4
BlockSelectionBox(origin=(-8, 0, -8), size=(16, 12, 16))

# 1.1.5
BlockSelectionBox().set_box(origin=(-8, 0, -8), size=(16, 12, 16))

Entity events and component groups

Custom entity events and component groups are now automatically prefixed with your project namespace (<namespace>:name), matching entity properties and block states.

  • Built-in minecraft: names (such as minecraft:entity_spawned) are preserved unchanged.
  • Already-namespaced names matching your project namespace (e.g. "myns:grow") are accepted without double-prefixing, and entity.server.event("grow") / entity.server.event("myns:grow") return the same object.
  • Foreign namespaces (e.g. "other:grow" when your project namespace is myns) now raise ValueError.
  • Where it applies: EntityServer.event(...), EntityServer.component_group(...), event actions (add_component_groups, remove_component_groups, set_trigger), EventTrigger and event/group fields across actor components (including EntityTransformation), Query.HadComponentGroup(...), and the default despawn event/group (now <namespace>:despawn).

Raw commands, Script API calls, and existing saves

Raw commands (such as add_queue_command(["event entity @s ..."]) or server animation timelines) and Script API calls (entity.triggerEvent("..."), dimension.spawnEntity(..., { spawnEvent: "..." })) are not rewritten. Update any custom event names in commands and TypeScript/JavaScript to include your project namespace (e.g. event entity @s myns:rust, entity.triggerEvent("myns:to_entity"), { spawnEvent: "myns:spawn_crew" }). Existing worlds saved before 1.1.5 will also drop renamed component groups on previously spawned entities until they are re-spawned.


Preview APIs merged into anvil.api & anvilconfig.json changes

Preview actor components, block components, filters, and features have moved from anvil.beta directly into anvil.api and are gated by features.preview (raising PreviewError when features.preview is off).

1.1.4 (anvil.beta) 1.1.5 (anvil.api)
anvil.beta.actors.components.* anvil.api.actors.components.*
anvil.beta.blocks.components.* anvil.api.blocks.components.*
anvil.beta.core.filters.Filter anvil.api.core.filters.Filter
anvil.beta.features.CrevasseFeature anvil.api.features.CrevasseFeature
anvil.beta.vanilla.* anvil.api.vanilla.*
# 1.1.4
from anvil.beta.actors.components import EntityImmovable, EntityProjectile

# 1.1.5
from anvil.api.actors.components import EntityImmovable, EntityProjectile

anvilconfig.json (features.preview and build.export_target)

  • build.preview moved to features.preview: controls the Minecraft target version (1.26.60 vs 1.26.70) and gates [PREVIEW] APIs.
  • build.local_export replaced by build.export_target: accepts strictly "release", "preview", or "local" (never arbitrary paths). On non-Windows platforms, "release" and "preview" fall back to "local" with a warning.
  • features.experimental is now independent of features.preview: you can enable experimental features on both Release and Preview builds.
  • Automatic upgrade: running a project automatically migrates build.preview → features.preview, migrates build.local_export → build.export_target, and deletes obsolete Anvil config keys from anvilconfig.json.

jsonmodel changes (custom components & contributors)

If you author custom JsonObject / JsonComponent classes directly:

  • Unified namespace resolution: Identifier.resolve(...) and the Namespaced marker (PropertyName, EventName, ComponentGroupName, plus BlockStateName) now back entity properties, block states, events, component groups, filters, and Molang queries. Passing an already-namespaced project name (like "myns:lit") no longer double-prefixes, and passing a foreign namespace raises ValueError.
  • KeyFramedColor is now a ready-made marker: write Annotated[..., KeyFramedColor] instead of Annotated[..., KeyFramedColor()].
  • AsObject was removed: use Pairs instead.
  • COLOR_SCHEMA was made private: it is no longer exported from anvil.lib.jsonmodel.
  • jsontypes is now a subpackage (base, constraints, objects, minecraft, colors), and @beta / is_beta / BetaError have been replaced by @preview / is_preview / PreviewError and @experimental / is_experimental / ExperimentalError in anvil.lib.jsonmodel.gates (plus field-level json_field(..., preview=True, experimental=True)). Public imports from anvil.lib.jsonmodel and anvil.lib.jsonmodel.jsontypes are updated accordingly.
  • Stricter validation:
  • Passing an uninstantiated JsonType class in Annotated[...] now raises TypeError instead of being silently ignored.
  • Passing an empty keyframe list ([]) to KeyFramed or KeyFramedColor now raises ValueError.
  • Negative speeds passed to MetersPerSecond now fail validation with a field-named ValueError.
  • Several AI goal and combat probability fields now enforce Chance (0..1) instead of only an upper bound of 1.

Other behavior changes

  • Render controller materials: calling controller.material("TailA", "glow") now layers on top of the default {"*": "material.default"} entry instead of dropping it. Calling controller.material("*", ...) replaces the default wildcard entry in place.
  • Geometry fit_to_frame: ItemDisplayGuiTransform(fit_to_frame=True) now keeps "fit_to_frame": {} in exported JSON (previously dropped during JSON normalization).
  • Mob and potion effect enums: mob effect fields (EntityAttack.effect_name, EntityMobEffect.mob_effect, EntityMobEffectImmunity, EntitySpellEffects, SpellEffect, ProjectileMobEffect, HealEffect, Filter.has_mob_effect) and LootTable SetPotion now require MinecraftEffects / MinecraftPotionEffectTypes instead of arbitrary strings (e.g. Filter.has_mob_effect(MinecraftEffects.Poison) instead of "poison").