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 asminecraft:entity_spawned) are preserved unchanged. - Already-namespaced names matching your project namespace (e.g.
"myns:grow") are accepted without double-prefixing, andentity.server.event("grow")/entity.server.event("myns:grow")return the same object. - Foreign namespaces (e.g.
"other:grow"when your project namespace ismyns) now raiseValueError. - Where it applies:
EntityServer.event(...),EntityServer.component_group(...), event actions (add_component_groups,remove_component_groups,set_trigger),EventTriggerand event/group fields across actor components (includingEntityTransformation),Query.HadComponentGroup(...), and the defaultdespawnevent/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.previewmoved tofeatures.preview: controls the Minecraft target version (1.26.60vs1.26.70) and gates[PREVIEW]APIs.build.local_exportreplaced bybuild.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.experimentalis now independent offeatures.preview: you can enable experimental features on both Release and Preview builds.- Automatic upgrade: running a project automatically migrates
build.preview→features.preview, migratesbuild.local_export→build.export_target, and deletes obsolete Anvil config keys fromanvilconfig.json.
jsonmodel changes (custom components & contributors)
If you author custom JsonObject / JsonComponent classes directly:
- Unified namespace resolution:
Identifier.resolve(...)and theNamespacedmarker (PropertyName,EventName,ComponentGroupName, plusBlockStateName) 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 raisesValueError. KeyFramedColoris now a ready-made marker: writeAnnotated[..., KeyFramedColor]instead ofAnnotated[..., KeyFramedColor()].AsObjectwas removed: usePairsinstead.COLOR_SCHEMAwas made private: it is no longer exported fromanvil.lib.jsonmodel.jsontypesis now a subpackage (base,constraints,objects,minecraft,colors), and@beta/is_beta/BetaErrorhave been replaced by@preview/is_preview/PreviewErrorand@experimental/is_experimental/ExperimentalErrorinanvil.lib.jsonmodel.gates(plus field-leveljson_field(..., preview=True, experimental=True)). Public imports fromanvil.lib.jsonmodelandanvil.lib.jsonmodel.jsontypesare updated accordingly.- Stricter validation:
- Passing an uninstantiated
JsonTypeclass inAnnotated[...]now raisesTypeErrorinstead of being silently ignored. - Passing an empty keyframe list (
[]) toKeyFramedorKeyFramedColornow raisesValueError. - Negative speeds passed to
MetersPerSecondnow fail validation with a field-namedValueError. - Several AI goal and combat probability fields now enforce
Chance(0..1) instead of only an upper bound of1.
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. Callingcontroller.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) andLootTableSetPotionnow requireMinecraftEffects/MinecraftPotionEffectTypesinstead of arbitrary strings (e.g.Filter.has_mob_effect(MinecraftEffects.Poison)instead of"poison").