Announcement 1.21.7

The 1.21.5/6/7 Update​

It's been a hot minute since the last post, but here we are! As always, backups are absolutely mandatory. After upgrading your world to 1.21.7, you cannot downgrade back to a lower version! We can also give you a pinky promise that it won't take this long to exit the experimental phase again and we have already addressed this inflexibility in build channels - more on below and on our Discord.

We would like to thank everyone that worked on this update:
If you'd like to support PaperMC as a whole, you can find more information at https://papermc.io/sponsors.

Release channel changes​

Among other changes and the new V3 of our downloads API, its release channels have changed to: alpha, beta, stable, recommended.
  1. alpha: Equivalent to the prior experimental label
  2. beta: New middle-point for builds that aren't entirely unstable, but partially unfinished (such as missing config options, or as with the long 1.21.5 phase, missing datafixer changes)
  3. stable: Equivalent to the prior default label - always make sure you stay up-to-date with new builds here, as important fixes and changes continue being pushed
  4. recommended: Unused in Paper, but currently used for Velocity releases. If this ever changes, we will announce it beforehand

force-upgrade startup param​

Time and time again, issues in old world upgrade code are found, with fairly important issues having been fixed by Mojang or Paper in the recent versions. If you use the force-upgrade startup flag, you lose out on fixes from future versions given it forcefully loads and upgrades all worlds and entities. Only if you are updating from a version before 1.13, force-upgrading can save some performance of the more expensive conversions, in that case the safer option is to force-upgrade on 1.21.7 Paper (!), but you should otherwise never force upgrade without a specific reason.

Reloading with /reload​

For many years, the Bukkit reload mechanic has been unofficially deprecated, with big warnings whenever some triggers it via /reload or a method in the API. We are officially deprecating it, to be removed at a later time. The /reload command will now point to the /minecraft:reload command, a reload mechanic that is and will stay supported, as it's a Vanilla mechanic. Users should be stopping and starting the server when they make changes that require a restart. Developers should be using hot reloading, or doing actual restarts as well. For guidance on how to hotswap, see the pinned messages in our paper-dev Discord channel.



For developers

Configuration phase API & deprecation of PlayerLoginEvent​

The use of PlayerLoginEvent is now deprecated. This change has been made to allow us to start developing API for the Configuration Phase in Minecraft. This most notably allows for dialoges to be sent to the player before they join the game, or for resource packs to be sent before as well. This is an early warning. While PlayerLoginEvent will remain available for now, breaking changes may be introduced in the future. Plugins relying on this event should begin migrating as soon as possible.

What You Should Use Instead

Please migrate to the following events based on your needs:

PlayerConnectionValidateLoginEvent
This should be used when wanting to control if a player should be able to join the game. Essentialy, any prevention of the player joining logic that was previously done in the PlayerLoginEvent. Note that this is ran two times, first when logging in, and then when exiting the configuration phase. So, you do not have access to a Player entity, only a PlayerProfile.

PlayerServerFullCheckEvent
A common use of the PlayerLoginEvent was to allow players to join the server even if it was full, this event allows you to override the fullness check for each player.

Other new configuration phase related events

The configuration phase has been added between logging into a server and fully joining a world. Here, server data, including tags and custom registry elements are sent to the client. It is in this phase that you send custom data to a client or where you an apply a resource pack before they exit the loading screen. On top of that, you can throw a player back into the configuration phase using PlayerGameConnection#reenterConfiguration and PlayerConfigurationConnection#completeReconfiguration
  • PlayerConnectionInitialConfigureEvent (when joining initially)
  • AsyncPlayerConnectionConfigureEvent
  • PlayerConnectionReconfigureEvent (when PlayerGameConnection#reenterConfiguration is called on an already joined player)

Dialog API​

Dialog API will be merged into 1.21.7 soon, we'll post a dev announcement once it's in! You can see its current status here: https://github.com/PaperMC/Paper/co...e20..11a1e0ffd25be0224c878ebaf629191863264861 / https://github.com/PaperMC/Paper/pull/12671

You will also be able open dialogs via a new click event type directly using ClickEvent.openDialog. For custom clicks actions, you may use the PlayerCustomClickEvent, but the better and preferred option is to directly pass a consumer-like callback in DialogAction.customClick, which will be run when the player clicks the specified element.

ItemStack config serialization​

ItemStacks now use the SNBT format when writing to configuration files. This allows us to run ItemStack upgrades through Minecraft's data fixers, going through much more reliable upgrades of existing stacks. Direct serialization of ItemMeta (as in, storing ItemMeta in a config) is now considered unsupported and will likely be removed in the future. If you want to serialize items to other formats, such as JSON or as before raw bytes, the (de)serializeStack methods on UnsafeValues might be of interest to you.

Cow and splash potion type changes​

Cow inheritance has been adjusted to fit Vanilla:
  • MushoomCow no longer extends Cow, but the new AbstractCow
  • Cow now extends AbstractCow
On top of that, the potion entity type has now been split up into splash and lingering potions, meaning you will now have to use those new entity types instead and will no longer be able to swap out an lingering for a splash potion and vice versa without creating a new entity.

Other API additions and changes​

Here is a small selection of recent API additions that might be interesting to you:
  • Registry events for modifying/adding custom cat, chicken, cow, frog, pig, and wolf variants, as well as damage types and paintings
  • Player#openVirtualSign to open unplaced signs. Changes can be checked via UncheckedSignChangeEvent
  • Entity#getPickItemStack to get the spawn egg/item for an entity when using the pick action on it
  • HumanEntity#setCooldown(Key, int ticks) and its getter for grouped cooldowns rather than single-item specific ones
  • Server#sendRichMessage(String) and sendPlainMessage for broadcasting and logging plain/minimessage text
  • Other new events, including PlayerMapFilledEvent, PlayerPickBlockEvent, PlayerPickEntityEvent, VaultChangeStateEvent, ClientTickEndEvent, EntityEquipmentChangedEvent, EntityAttemptSmashAttackEvent, PlayerClientLoadedWorldEvent, EntityEffectTickEvent
 
Last edited by a moderator:
Super excited for the Dialog API! Vanilla is inching towards Garry’s Mod/Roblox level server-client customization, and I can’t wait to see what plugin devs will do with it
 
  • Like
Reactions: Camm