Skip to content

Implement Code of Conduct handling in player configuration#682

Draft
emmanuelvlad wants to merge 1 commit intominekube:masterfrom
emmanuelvlad:feat/code-of-conduct
Draft

Implement Code of Conduct handling in player configuration#682
emmanuelvlad wants to merge 1 commit intominekube:masterfrom
emmanuelvlad:feat/code-of-conduct

Conversation

@emmanuelvlad
Copy link
Copy Markdown
Contributor

This PR introduces a new event-driven mechanism to handle the Code of Conduct (CoC) acceptance flow during the backend configuration stage for Minecraft 1.21.9+ clients.

The main changes add extensibility for sending and handling CoC packets, ensuring the proxy can pause configuration until the player accepts the CoC, and cleanly resume configuration afterward.

I am not entirely sure this is the best way to implement it. Let me know if there's a better way to do it, feedback appreciated!


Here is an implementation example on a proxy:

return func(e *proxy.PlayerConfigurationStartEvent) {
  payload, ok := getCodeOfConduct(e.Player().Settings().Locale().String()) // returns []byte, bool
  if !ok {
	return
  }
  e.SendCodeOfConduct(payload)
}

@emmanuelvlad emmanuelvlad marked this pull request as draft April 9, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant