Candy Box Wiki
Register
Advertisement

By going to the Javascript/Developer's Console, the player can manipulate the game. Please note that these are for Candy Box. They apparently won't work in Candy Box 2. However, it is still possible to 'cheat' in Candy Box 2. For simplicity, cheats for Candy Box 2 are kept at Cheats/Candy Box 2 to avoid confusion between the two games and their methods.

This can be done whenever the player wants to in the game, and doesn't require anything to be unlocked to access. A wide range of things can be done, such as giving yourself more candies, lollipops, and any kinds of potions.

How to get there[]

Firefox Java Console

If it works, the console will appear at the bottom of your screen. Click to enlarge.

To get to the console, simply follow these keyboard directions, based on which browser you use:

  • Chrome: Press Ctrl. + Shift + J
    Or: Crtl. + Shift + I
    Or: F12
  • Safari: Press Ctrl. + Alt + C                                         or Command + Option + C
  • Internet Explorer 9: Press F12, then click the 'Console' tab
  • Firefox: Press Ctrl. + Shift + K
    Or (if Firebug is installed): Press F12, then click the 'Console' tab
  • Opera Press Ctrl. + Shift + I
What you can do

An impressive array of things can be changed to the player's liking. This is useful for if the player wants to beat the game quicker, or just play around.

Candies[]

Owned[]

To give yourself free candies, enter this code into the console box, replacing 'x' with how many candies you want:

candies.setNbrOwned(x)

Production[]

Or, if you prefer earning your candies, enter this coding into the box, replacing 'x' with how many candies you want per second:

candies.candiesPerSecond = x;

Eaten[]

By increasing your candies amount, you can then eat them to get an insanely high amount of health. However, this can be a problem for the quest level Yourself, as your enemy has the same amount of health as you. Thus, it can take a very, very long time to win the level. Read on for how to reset your health.

To reset (or increase) the amount of candy you have eaten (and thus your health), enter this code into the console box (replace x with whatever number you want if you want to increase your health instead):

candies.setNbrEaten(x);

Invincibility[]

This coding can also be used to make yourself truly invincible. It appears to be the only way to legitimately take on the Developer, as normally the player has to kill him by clicking a random key. To make yourself invincible, simply enter a negative number for how many candies you have eaten, which will change your health to NaN/NaN:

candies.setNbrEaten(-1);

However: It will be impossible you defeat "Yourself" after using this. If you find yourself fighting yourself with infinite health, use an Escape Potion to leave the quest, and then use the above coding, except with 0 as the value (instead of a negative number) to reset your health.

Hard mode: As health in hard mode is unaffected by the number of candies eaten, this alternate method may be used.

quest.beginInvulnerability =
function(){
    this.invulnerability = true;
    this.invulnerabilityCountdown = 999999;
    this.things[this.getCharacterIndex()].text = "GOD";
};

The above code will set the Invulnerability potion effect to last 999999 ticks or approximately 92 hours, essentially making the player invincible for the entire quest.

Thrown[]

You can also change how many candies you have thrown on the ground. As throwing candies on the ground normally doesn't accomplish anything, neither does this. To do it, enter this code in the console box, replacing 'x' with how many candies you want thrown on the ground:

candies.setNbrThrown(x);

Lollipops[]

Owned[]

To change the amount of lollipops owned, enter this code into the console box, replacing 'x' with how many lollipops you want owned.

lollipops.setNbrOwned(x)

Production[]

Like the candies, you can also set how many lollipops you get per second. Replace 'x' with number of lollipops you want per second.

 lollipops.lollipopsPerSecond = x;

[]

Chocolate bars[]

Enter this code below to get how many chocolate bars you want. Replace 'x' with how many chocolate bars you want. If you attain over one, it will say "a bug ? oO".

chocolateBars.setNbrOwned(x)

Quest waiting-time[]

Early on in the game, waiting to do another quest can sometimes get boring. To skip this, enter this coding, which sets the wait time to end:

quest.tiredTime = 0

Rather than manually setting the wait timer after every quest, you can enter the following code to remove wait times altogether.

quest.setTiredTime = function(value){
    if(true) value = 0;

    this.tiredTime = value;
    this.defineMood();
    buttons.checkQuestTiredTime();
}

Potions[]

If you do not want to go through the procedure of making potions, or don't have the resources to do so, you can give yourself more.

Note: It appears you have to have had made the potion (that you are entering code to get more of) at least once for the code to work.

By entering some code, the player can earn as many potions as they want. Enter this code into the console, replacing X with how many you want, and replacing XX with the type of potion:

    newPotionNum = X; // ...
    potions.setPotionNbrOwned(potions.list.XX, newPotionNum);
    potions.updateOnPage();

For example, if you wanted twenty Berserk potions (as they are normally a limited potion), enter:

    newPotionNum = 20; // ...
    potions.setPotionNbrOwned(potions.list.berserk, newPotionNum);
    potions.updateOnPage();

Alternatively, you can invoke the following, where XYZ is one of the potions you desire to add, which should work even for potions you have not crafted (tested with turtle potion):

    potions.getPotions(potions.list.XYZ, newPotionNum);

Note that the potion name usually shouldn't be capitalized. In the case of the G.M.O.O.H. potion, spell it "gmooh". For the Major health potion, spell it "majorHealth". Magical jellies and magical seeds can be obtained this way (by entering "jelly" and "seed", respectively), despite technically not being potions.

Full list of potions from potions.list:

acidRainScroll:{buttonText: "Acid rain scroll", buttonColor: "#68980b", action: "potions.acidRainScroll();", shown: true, nbrOwned: 45, …}
berserk:{buttonText: "Berserk potion", buttonColor: "#000000", action: "potions.berserk();", shown: true, nbrOwned: 0, …}
cloning:{buttonText: "Cloning potion", buttonColor: "#6d6d6d", action: "potions.cloning();", shown: true, nbrOwned: 0, …}
earthquakeScroll:{buttonText: "Earthquake scroll", buttonColor: "#470b0b", action: "potions.earthquakeScroll();", shown: true, nbrOwned: 12, …}
escape:{buttonText: "Escape potion", buttonColor: "#51c90f", action: "potions.escape();", shown: true, nbrOwned: 17, …}
fireScroll:{buttonText: "Fire scroll", buttonColor: "#dc3e00", action: "potions.fireScroll();", shown: true, nbrOwned: 49, …}
gmooh:{buttonText: "G.M.O.O.H. potion", buttonColor: "#ff00c0", action: "potions.gmooh();", shown: false, nbrOwned: 0, …}
health:{buttonText: "Health potion", buttonColor: "#ff0000", action: "potions.heal(50);", shown: true, nbrOwned: 54, …}
impInvocationScroll:{buttonText: "Imp invocation scroll", buttonColor: "#ff6600", action: "potions.impInvocationScroll();", shown: true, nbrOwned: 39, …}
invulnerability:{buttonText: "Invulnerability potion", buttonColor: "#ef893b", action: "potions.invulnerability();", shown: true, nbrOwned: 986, …}
jelly:{buttonText: "Jelly", buttonColor: "#9500b5", action: "potions.jelly();", shown: false, nbrOwned: 0, …}
majorHealth:{buttonText: "Major health potion", buttonColor: "#ff0000", action: "potions.heal(100);", shown: false, nbrOwned: 0, …}
seed:{buttonText: "Seed", buttonColor: "#3dab3a", action: "potions.seed();", shown: false, nbrOwned: 0, …}
superman:{buttonText: "Superman potion", buttonColor: "#ddef17", action: "potions.superman();", shown: true, nbrOwned: 6, …}
teleportScroll:{buttonText: "Teleport scroll", buttonColor: "#7ca0b5", action: "potions.teleportScroll();", shown: true, nbrOwned: 54, …}
turtle:{buttonText: "Turtle potion", buttonColor: "#008a13", action: "potions.turtle();", shown: false, nbrOwned: 0, …}

This code gives you infinite potions including seeds and jellies (only one code):

    for ( var potionName in potions.list ) {
  var potion = potions.list[ potionName ];
  potion.nbrOwned = Number.POSITIVE_INFINITY;
  potion.shown = true;
}

Sword[]

To change the sword you currently have, use this code, replacing X with the name of your sword (with spaces):

sword.name = "X"

For example, if you want the chocolate sword, type this:

sword.name = "chocolate sword"

To change the sword's level, replace X with the number of the level you want:

sword.specialPower = "X"

G.M.O.O.H.[]

To activate a G.M.O.O.H. quest, use this code (while you're on a quest):

quest.gmooh = true
Advertisement