[MC-2911] Gamerule commands allow parameters other than true/false Created: 13/Nov/12  Updated: 06/Aug/14  Resolved: 31/Jul/14

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.4, Minecraft 1.4.7, Snapshot 13w06a, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.7.4, Minecraft 14w03b, Minecraft 14w04b, Minecraft 1.7.9, Minecraft 14w17a, Minecraft 14w18b, Minecraft 1.7.10, Minecraft 14w28a, Minecraft 14w28b
Fix Version/s: Minecraft 14w32a

Type: Bug
Reporter: Mustek Assignee: [Mojang] Searge (Michael Stoyke)
Resolution: Fixed Votes: 8
Labels: None
Environment:

N/A


Issue Links:
Bonfire Testing
discovered while testing MC-2887 Fire doesn't spread :( Resolved
Duplicate
is duplicated by MC-34802 Gamerule Problems - Not working, any ... Resolved
is duplicated by MC-49720 /gamerule values can literally be set... Resolved
is duplicated by MC-53934 gamerule value Resolved
is duplicated by MC-64483 Gamerules accept nonboolean input Resolved
CHK:
Confirmation Status: Confirmed

 Description   

When issuing a gamerule command, for example:
/gamerule doFireTick on, the game will accept that "on" parameter without throwing any errors.

This can result into major confusion, since the game will parse anything other than "true" as false.

Expected

  • Throw an error for an incorrect paramter

What happens

  • The game accepts the faulty parameter, yet considers it as false

To reproduce
1. Change a gamerule to anything other than "true/false"
2. Check the gamerule, it will say the exact parameter that was entered
3. Notice that it will be considered as false



 Comments   
Comment by Hun_Norberto [ 06/Aug/14 ]

Hey, I liked that "feature" and it's now fixed...
/gamerule mobGriefing nope

Comment by Sam Bone [ 02/Aug/14 ]

Nice, but when creating a gamerule/scoreboard objective I always put the first word lowercase and the rest capital for example /gamerule spongesAreAmazing true. BTW related to MC-65113.

Comment by Marcono1234 [ 12/Jul/14 ]

Confirmed for 14w28b

Comment by Itouch2 [ 08/May/14 ]

Confirmed for 14w18b.

Comment by Dlawso the Really Lucky Rabbit [ 29/Apr/14 ]

NOT intended. This is about parameters, not value.

Comment by Kumasasa [ 28/Jan/14 ]

Anything except true is false, thus /gamerule doTileDrops IDoNotWantMyTilesToDrop will work too...

Comment by Deleted account [ 28/Jan/14 ]

Also note that /gamerule doTileDrops 0 works (0 = false) while /gamerule doTileDrops 1 doesn't do anything.

Comment by [Mod] CubeTheThird [ 26/Sep/13 ]

Is this still a concern in the current Minecraft version 1.6.4 / Launcher version 1.2.5 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Kumasasa [ 04/Apr/13 ]

The gamerules are parsed with parseBoolean, the only recognized keyword is "true" (in any case):

public static boolean parseBoolean(String s)

Parses the string argument as a boolean. The boolean returned represents the value true if the string argument is not null and is equal, ignoring case, to the string "true".
Example: Boolean.parseBoolean("True") returns true.
Example: Boolean.parseBoolean("yes") returns false.

Comment by Ashadi [ 11/Mar/13 ]

also affects pre 1.5 it only accepts the word "TRUE" lower or uppercase mix up doesn't matter, but the only way to turn it on the word 'on' is wrong is the word "true" any other value it will be accepted and be turned false off but will show the value introduced, works on single and multi player.

tried on a flat world, changing to any difficulty, and died on purpose several times wither fall damage or killed by zombies.

way to reproduce and easy to be misleaded into

  • type /gamerule keepInventory
  • shows keepInventory off
    -->this part i thought i could write 'on' due to the game telling me it was 'off'
  • type /gamerule keepInventory on
  • shows keepInventory on
    -->didn't knew the value is still off, seems 'on' and 'off' are just display info not a real value
  • die in anyway
  • inventory droped

worked on win7, lastest java and preMc release at the time of the post, i found out in multiplayer while deep underground killed by cavespiders x.x R.I.P. our loot

Comment by Mustek [ 13/Nov/12 ]

See issue MC-2887 for an example of confusion that this issue causes.

Generated at Sun Jan 12 11:59:27 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.