Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Set Game Rule

Play 0x39, client → server.

play · 0x39 · serverbound (client → server)

Requests a game rule change from the in-game game rule editing screen. It identifies the gameRule and its new value. The server applies it only if the player has permission for the /gamerule command.

Sent by the client, read by the server. Listen for it with client.on("SetGameRule", (data) => …) on the receiving side.

Fields

Field Type Notes
rules Array

Send it

await client.sendPacket("SetGameRule", {
  rules: /* Array */,
});

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/serverbound/SetGameRule.ts

Was this page helpful?