top of page

🎮 Using Gamerules in Minecraft

  • Foto del escritor: PixelHost
    PixelHost
  • 14 ago 2024
  • 4 Min. de lectura

Actualizado: 28 ago 2024

Gamerules allow server owners to customize various aspects of gameplay, offering a high level of control over the in-game experience.



🛠️ Gamerule Commands

  • How to Set a Gamerule Value:

    • /gamerule <rule name> <value>

  • How to Check the Current Value of a Gamerule:

    • /gamerule <rule name>


The rule name refers to the specific gamerule you want to set or check. A list of these gamerules is provided below.

The value is what you want to set for that specific rule. In most cases, this is a boolean value (true or false), but sometimes it can be a number.

Each command should be entered in the game chat by an Admin/OP or in the server console.

For Bedrock servers, when entering the command in the server console, the “/” should be omitted; otherwise, you will receive the following error: "Unknown command: /. Please check that the command exists and that you have permission to use it."

📋 Common Gamerules

Here’s a list of common gamerules you might want to use on your Minecraft server:

  1. doDaylightCycle: Controls whether the day/night cycle is active.

    • Values: true (enabled), false (disabled).

  2. keepInventory: Determines if players keep their inventory upon death.

    • Values: true (yes), false (no).

  3. mobGriefing: Controls whether mobs can alter the environment.

    • Values: true (enabled), false (disabled).

  4. doFireTick: Controls whether fire spreads and consumes blocks.

    • Values: true (enabled), false (disabled).

  5. doMobSpawning: Determines if mobs spawn naturally.

    • Values: true (enabled), false (disabled).

🔍 Example: Setting and Checking a Gamerule in the PixelHost Server Console

For example, if you want to disable fall damage on your server, you would use the following command:

  • Java Edition:

    • /gamerule fallDamage false


  • Bedrock Edition (in the server console):

    • gamerule fallDamage false

Remember that in the Bedrock server console, you need to omit the "/" when entering the command, or you will receive an error.


Gamerules List

Rule Name

Description

Possible Values

Default Value

Java Edition

announceAdvancements

Whether advancements should be announced in the chat

true/false

true

✔️

commandBlocksEnabled

Whether command blocks should be enabled in the game

true/false

true

commandBlockOutput

Whether command blocks should notify administrators when they execute commands

true/false

true

✔️

disableElytraMovementCheck

Whether the server should skip the speed check when the player uses an elytra

true/false

false

✔️

disableRaids

Whether raids are disabled or not

true/false

false

✔️

doDaylightCycle

Whether the day-night cycle and moon phases advance

true/false

true

✔️

doEntityDrops

Whether non-mob entities should drop items

true/false

true

✔️

doFireTick

Whether fire should spread and naturally extinguish

true/false

true

✔️

Rule Name

Description

Possible Values

Default Value

Java Edition

doInsomnia

Whether phantoms can appear during nightmares

true/false

true

✔️

doImmediateRespawn

Players respawn immediately without showing the death screen

true/false

false

✔️

doLimitedCrafting

Whether players can only craft recipes they have unlocked first

true/false

false

✔️

doMobLoot

Whether mobs should drop items

true/false

true

✔️

doMobSpawning

Whether mobs should spawn naturally

true/false

true

✔️

doPatrolSpawning

Whether patrols can spawn

true/false

true

✔️

doTileDrops

Whether blocks should drop items

true/false

true

✔️

doTraderSpawning

Whether wandering traders can spawn

true/false

true

✔️

doWeatherCycle

Whether the weather should change

true/false

true

✔️

drowningDamage

Whether the player should take damage from drowning

true/false

true

✔️

Rule Name

Description

Possible Values

Default Value

Java Edition

fallDamage

Whether the player should take damage from falling

true/false

true

✔️

fireDamage

Whether the player should take damage from fire

true/false

true

✔️

forgiveDeadPlayers

Causes neutral mobs to stop being angry when the target player dies near them

true/false

true

✔️

freezeDamage

Whether the player should take damage from being inside powder snow

true/false

true

✔️

functionCommandLimit

The maximum number of commands a function can run at once

number

10000

keepInventory

Whether the player should keep their items in their inventory after death

true/false

false

✔️

logAdminCommands

Whether admin commands should be logged in the server log

true/false

true

✔️

Rule Name

Description

Possible Values

Default Value

Java Edition

maxCommandChainLength

Determines the number at which the chain command block acts as a "chain"

number

65536

✔️

maxEntityCramming

The maximum number of entities that another entity can push before taking suffocation damage

number

24

✔️

mobGriefing

Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers can modify blocks, and whether villagers, zombies, skeletons, and zombie pigmen can pick up items

true/false

true

✔️

Rule Name

Description

Possible Values

Default Value

Java Edition

naturalRegeneration

If the player can naturally regenerate health if their hunger is sufficient (does not affect external healing, such as golden apples, the Regeneration effect, etc.)

true/false

true

✔️

playersSleepingPercentage

The percentage of players that must sleep to skip the night

number

100

✔️

pvp

If the player can fight with other players

true/false

true

randomTickSpeed

How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 disables random ticks, higher numbers increase the frequency of random ticks

number

3 (JE) / 1 (BE)

✔️


Rule Name

Description

Possible Values

Default Value

Java Edition

reducedDebugInfo

If the debug screen shows all information or reduced information; and whether the effects of F3+B (entity hitboxes) and F3+G (chunk borders) are shown or not

true/false

false

✔️

sendCommandFeedback

If comments from commands executed by a player should appear in the chat. Also affects the default behavior of command blocks storing their output text.

true/false

true

✔️

showCoordinates

If the player's coordinates are displayed

true/false

true

showDeathMessages

If a message appears in the chat when a player dies

true/false

true

✔️

Rule Name

Description

Possible Values

Default Value

Java Edition

spawnRadius

The number of blocks outward from the world's spawn coordinates where a player will appear when they join the server or die without a spawn point

number

10 (JE) / 5 (BE)

✔️

spectatorsGenerateChunks

If players in spectator mode can generate chunks

true/false

true

✔️

tntExplodes

If TNT will explode after being activated

true/false

true

universalAnger

Makes neutral mobs attack any nearby player, not just the player who angered them. Works best if you disable forgiveDeadPlayers

true/false

false

✔️

showTags

Hides the "Can place on" and "Can destroy" block lists from the item description

true/false

true

Best Regards,

João @PixelHost.


Comments


bottom of page