Skip to content

PlayerJoinEvent fires before Mojang "Code of Conduct" screen is acknowledged #13389

@DereC4

Description

@DereC4
Image

Expected behavior

The PlayerJoinEvent should ideally fire only when the player has bypassed the newly added Code of Conduct screen. Alternatively, there should be a way to distinguish if a player is currently "locked" behind the mandatory Mojang Code of Conduct (CoC) screen.

Observed/Actual behavior

When a server has the Mojang Code of Conduct screen enabled (or it is triggered by the client/registry), PlayerJoinEvent fires as soon as the connection is established, because this screen (if i am correct) will show up after the player has been authenticated, and passed any whitelist checks.

However, the player is still stuck on the "Code of Conduct" UI. During this time:

The player cannot see chat or titles sent during the join event.

The player has not physically "spawned" in a way that allows for standard interactions.

Plugins attempting to teleport the player or modify their state immediately upon joining may fail.

Steps/models to reproduce

  1. Ensure the server/environment is set up to trigger the mandatory Mojang Code of Conduct screen upon join (common in certain regions or specific server.properties configurations regarding player safety).
  2. Create a simple listener for PlayerJoinEvent that sends a message or a title to the player.
  3. Join the server with an account that has not yet acknowledged the CoC.
  4. Observe that the console logs the join and the plugin fires its logic, but the player is still looking at the Mojang CoC modal and misses all initial join logic.

Plugin and Datapack List

Guests

Paper version

[01:05:09 INFO]: This server is running Paper version 1.21.10-117-ver/1.21.10@df4b668 (2025-11-30T22:37:28Z) (Implementing API version 1.21.10-R0.1-SNAPSHOT)

Other

I make this because I was testing a guest verification plugin I developed, and it works for servers without this code of conduct option enabled, but upon enabling, the code will not trigger for players who are locked by the screen it appears, and they have to rejoin, make sure the screen is checked to not appear again, for the behavior to work.

https://github.com/Derec-Mods/Guests

  • DerexXD

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions