Skip to content

Instantly share code, notes, and snippets.

@apple502j
Last active October 15, 2023 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apple502j/316058b94db3fff38e3eddbb981c6811 to your computer and use it in GitHub Desktop.
Save apple502j/316058b94db3fff38e3eddbb981c6811 to your computer and use it in GitHub Desktop.

23w41a: Command Update

Commands received the biggest change in this snapshot. With the help of the new Brigadier function and the advanced command execution implementation, commands were significantly enhanced.

Fabric update

Fabric API 0.90.1 was released, with no breaking changes.

Minecraft changes

There is no progress on last week's block codecs. This week, we instead saw a massive refactor in commands.

Commands

Previously, command execution was handled by Brigadier's internal methods. This did not work well for commands that invoke other commands, like execute if and return run. This update gave the Minecraft code more control in executing commands. Since most mods likely do not depend on this functionality, this section only describes changes, not new features.

  • ResultConsumer is replaced with context-aware ResultStorer in many places. Methods were renamed accordingly.
  • CommandManager#execute methods no longer return int return values. To get the return value, use ServerCommandSource#withResultStorer.

Entities

  • Boats, minecarts, and other player-constructed vehicles should now extend VehicleEntity. This provides the wobble effect seen when hitting that entity.
  • ItemEntity#thrower was renamed to throwerUuid, and a field for the entity, now named thrower, was added. setThrower now takes an entity.
  • Various non-living entities (including projectiles and TNT) received copyFrom override to copy the owner. If you have a custom non-living entity, make sure to follow the same!
  • Entity#getScoreboardTeam now returns Team, not AbstractTeam.
  • PlayerEntity#getReachDistance static method was added. This returns the reach distance for the player.

Misc

  • AbstractBlock#onStateReplaced implementations for block entities were consolidated to ItemScatterer#onStateReplaced. Make sure to call super AFTER calling ItemScatterer.
  • SignBlockEntity#getInteractionFailSound was added, returning interaction fail sound.
  • FireBlock#registerFlammableBlock is now public.
  • Colors#LIGHT_RED was added.
  • Herobrine was removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment