You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
World: game rules, world border, getHighestBlockAt, generateTree, getNearbyEntities, batchSpawn, structure API (save/load/delete/list), createWorld/deleteWorld
Entity.__bool__() via isValid()
Refactoring & Code Quality
Comprehensive docstrings added across all Python modules and extensions
Whitespace normalization and consistent spacing across Python source
Type annotations tightened: lazy imports, Optional callables, assertion guards
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
3C
Plugging some old holes in the API. Full codebase cleanup. New extensions.
Changes
New Extensions
%placeholder%expansions with per-player context and batchresolve_many()@every()/@after()decorators and cancellationon_enter/on_exit/on_tickcallbacks and event-driven transitionsNew APIs
@preservedecorator: hot-reload state persistence — caches return value to JSON and restores across/pjb reloadfire_event(event_name, data)— scripts can fire and listen to custom events across scriptsVillager.recipes(get/set),recipe_count,add_recipe(),clear_recipes()velocity,fire_ticks,custom_name,gravity,glowing,invisible,invulnerable,silent,persistent,collidable,bounding_box,metadatagoal_types,remove_goal(),remove_all_goals()hidePlayer/showPlayer/canSee,openBook,sendBlockChange,sendParticle, cooldown management, statistics,getMaxHealth/setMaxHealth, bed spawn, compass target, PersistentDataContainer accessgetDrops,getHardness,getBlastResistance, PersistentDataContainer for tile entitiesisUnbreakable/setUnbreakablegetHighestBlockAt,generateTree,getNearbyEntities,batchSpawn, structure API (save/load/delete/list),createWorld/deleteWorldEntity.__bool__()viaisValid()Refactoring & Code Quality
str.removeprefix()modernization replacingstartswith()+ sliceserver.playersde-awaited in guild, leaderboard, npc, region (was incorrectlyawaited)@preserveevent handlers fixed: lambdas replaced with proper async def functions-Xlint:deprecationOptimizations — Java
getDrops→List.copyOf(),clearRecipes→List.of()List.of()return for null modifiersgetCachedMethod(), pre-sized lists indispatchBlockMulti()Optimizations — Python
_ENUM_TYPE_MAPPINGmoved to module-level constant (was recreated on every enum deserialization)_JSON_SEPARATORS,_RESERVED_KWARGSfrozenset,_MINECRAFT_PREFIXEStuple: module-level constantsevent_batchhandler inlined: avoids temp dict creation and full re-dispatch per payload"x" in dinstead offrozenset.issubset(d.keys())import math/import loggingmoved to module-level__slots__added to 27 classes across helpers and extensionstransfer()to avoid double_save()add_xp,xp_to_next/progressavoid redundant bridge callremaining_cooldownto avoid doubletime.time()+ double dict lookup.get()lookup instead ofin+[]_toml_write_table(): single-pass scalar/sub-table separationBug Fixes
server.playersincorrectly awaited in guild, leaderboard, npc, region@preserveevent handler signature (lambda → async def)setLoreNPE when argument is not a list (added else branch withList.of())Documentation & Tooling
This discussion was created from the release 3C.
All reactions