Minecraft Cheat Codes and Console Commands for PC, PS5, and Xbox are built into the game. Enable cheats in a world, open chat, and use commands to change game modes, teleport, spawn items, control weather, and manage players without mods.
Minecraft Cheat Codes and Console Commands
This guide covers the most useful commands for Minecraft Java Edition and Bedrock Edition.
It includes step-by-step setup for PC, PS5, and Xbox, practical command examples, edition differences, and safety tips based on how these commands behave in real worlds.
How to Enable Minecraft Cheat Codes and Console Commands
Cheats must be enabled before most Minecraft commands will work. The process differs slightly between Java Edition and Bedrock Edition, but it usually takes only a few steps.
PC: Java Edition
- When creating a world, open More World Options.
- Set Allow Cheats to On.
- Create the world, then open chat to enter a command beginning with
/.
To temporarily enable commands in an existing Java world, pause the game, choose Open to LAN, and set Allow Cheats to On.
This permission normally lasts only while that LAN session remains open, so it is useful for testing a build or fixing a stuck player.
PC: Bedrock Edition
- When creating a world, turn on Activate Cheats.
- For an existing world, open Settings.
- Select Game, then enable Cheats.
Bedrock Edition uses the same general command system on Windows PC, PS5, and Xbox. However, item IDs, entity names, and command arguments can differ from Java Edition.
Use the in-game command suggestions after typing / whenever you are unsure.
PS5 and Xbox
Open the world settings, select Game, and activate Cheats. Then open the chat and command entry screen with the console's chat control. A keyboard can make long commands easier to enter, but a controller also works.
Important: Activating cheats permanently disables achievements for that Bedrock world.
If you are working toward achievements, create a separate testing world instead of changing your main survival save. Java Edition uses advancements rather than Bedrock achievements, so the effect is not identical across editions.
Essential Minecraft Cheat Codes and Console Commands
Most commands start with a forward slash, such as /gamemode or /give. Target selectors determine who or what the command affects:
@stargets the command source, usually you.@atargets every player.@ptargets the nearest player.@etargets every entity, including mobs and dropped items.
Selectors are powerful because a command aimed at @s affects one player, while the same command aimed at @a can affect everyone online. Check the selector before pressing Enter.
Change Your Game Mode
/gamemode creativegives unlimited building resources and removes normal survival limits./gamemode survivalreturns you to standard survival gameplay./gamemode spectatorlets you fly through blocks and observe the world without normal interaction.
A useful example is switching to Creative to test a redstone machine, then returning to Survival after the design works. This saves time while keeping the final play session challenging.
Give Yourself Items
/give @s diamond 64
/give @s netherite_sword 1The first command gives you 64 diamonds, while the second gives you one netherite sword.
Replace the item ID with a valid name for the item you need. In Bedrock, the autocomplete list is especially helpful because some names and data formats differ from Java.
For a safer workflow, test item commands in a copy of your world. This is useful when building a large project:
give yourself only the blocks needed for a planned structure, rather than using a broad command that changes multiple players or containers.
Minecraft commands, quantified
Teleport to Coordinates
/tp @s 100 64 200
/tp @s ~ ~10 ~The first command sends you to X 100, Y 64, and Z 200. Minecraft coordinates always use three values: X for east and west, Y for height, and Z for north and south. The second command moves you 10 blocks upward because the tilde makes the Y value relative to your current position.
Check your coordinates before using an absolute teleport. A wrong Y value can place you inside a cave, in lava, or above the void. Teleporting to a safe test area first is a simple way to avoid losing a survival inventory.
Weather, Time, and World Control Commands
These Minecraft Cheat Codes and Console Commands help with building, recording gameplay, testing farms, and setting a particular atmosphere.
/time set daychanges the world to daytime./time set nightchanges the world to nighttime./weather clearstops rain and storms./weather thunderstarts a thunderstorm./gamerule doDaylightCycle falsefreezes the current time./difficulty hardsets the difficulty to Hard for the world./seeddisplays the current world seed.
For example, builders often freeze daylight while placing blocks or recording a tutorial. Restore the normal cycle with /gamerule doDaylightCycle true when you finish. Remember that world rules can affect every player, not just the person who entered the command.
or
Bedrock?Choose your edition
Survival Shortcuts, Effects, and Item Spawning
Commands can solve problems quickly, but powerful effects should be tested in a temporary world first. Keep a backup before changing a shared survival world.
Health, Food, Experience, and Enchantments
/effect @s minecraft:instant_health 1 255applies an instant-health effect with a duration of 1 and amplifier 255./effect @s minecraft:saturation 99999 255gives a very long saturation effect./enchant @s sharpness 5applies Sharpness 5 to a compatible held item./xp add @s 1000 levelsadds 1,000 experience levels.
Effect and enchantment syntax can vary between Java and Bedrock. An enchantment will also fail if the held item is not compatible. If a command is rejected, check the suggestions shown by your edition instead of copying Java syntax into a Bedrock world.
Remove Entities Carefully
/kill @e[type=!player]This command removes all entities except players. It may clear hostile mobs and reduce lag, but it can also remove pets, villagers, minecarts, dropped items, armor stands, and other important objects. Do not use it as routine cleanup unless you have confirmed exactly what the selector includes.
Rare Resources and End-Game Items
/give @s netherite_ingot 4
/give @s ancient_debris 8
/give @s elytra 1
/give @s totem_of_undying 5
/give @s ender_dragon_spawn_egg 1These commands provide four netherite ingots, eight ancient debris, one elytra, five Totems of Undying, and one Ender Dragon spawn egg. The spawn egg can create serious performance and world-management problems, especially in a confined area.
Use it only in a test world unless you are prepared to deal with the result.
On PC, decide whether you are using Java Edition or Bedrock Edition. PS5 and Xbox use Bedrock, so the same general command system applies across those consoles and Windows Bedrock.
For a new Java world, open More World Options and turn Allow Cheats on. In Bedrock, turn on Activate Cheats while creating the world. For an existing Bedrock world, open Settings, select Game, and enable Cheats.
Enter the world, open chat, and begin the command with a forward slash. On Java, an existing world can temporarily use commands through Pause, Open to LAN, and Allow Cheats; that permission lasts for the LAN session.
Use autocomplete after typing / to confirm edition-specific syntax. Try selectors such as @s for yourself or @a for every player, then verify the result. Check permissions, item IDs, entity names, and arguments if a command fails.
Minecraft Console Commands for Multiplayer Servers
Server commands usually require operator permissions. On a private world, you may gain access after enabling cheats, while a dedicated server normally uses permission settings or an operator list.
/op usernamegives a player operator status./ban usernamebans a player from the server./whitelist add usernameadds a player to the whitelist./seedreveals the current world seed./difficulty hardchanges the difficulty for everyone.
Replace username with the exact in-game name. Grant operator status carefully: an operator can often change world rules, remove entities, manage players, and run commands that cannot be undone easily.
“Commands are powerful tools for changing the game world and managing gameplay.” — Mojang, official Minecraft Help guidance
This principle is worth following whether you play alone or with friends. Mojang's official help documentation and the command suggestions inside Minecraft are the best places to verify syntax after an update. You can also review this Minecraft command reference guide before using unfamiliar selectors.
Which Minecraft Commands Work on PS5 and Xbox?
PS5 and Xbox use Bedrock Edition, so they support the Bedrock command system rather than Java Edition commands. Core commands such as /give, /tp, /time, /weather, and /gamemode are available when cheats are enabled and you have permission.
Java commands do not transfer perfectly to consoles. Differences may include item IDs, effect syntax, entity names, and accepted arguments. If a command fails on PS5 or Xbox, type the slash and use the command list shown by Bedrock. That live help is usually more reliable than an old copy-and-paste example.
FAQ: Minecraft Cheat Codes and Console Commands
Do Minecraft cheats require mods?
No. Minecraft has a built-in command system, so you do not need mods or third-party tools. Cheats must be enabled, and you must have permission to run the command.
Do cheats disable achievements?
Yes. Activating cheats permanently disables achievements for that Bedrock world. Use a separate creative or testing world if achievement progress matters to you.
Can I use these commands on PS5 and Xbox?
Yes. Most commands in this guide work on both consoles because they use Bedrock Edition. Java syntax may need changes, so use the Bedrock autocomplete suggestions.
What do the three teleport numbers mean?
They are X, Y, and Z coordinates. X and Z identify horizontal location, while Y identifies height. For example, /tp @s 100 64 200 sends you to X 100, Y 64, and Z 200.
What should I do if a command fails?
Confirm that cheats are enabled, check your permissions, and review the command suggestions in chat. Then verify the item ID, selector, and edition-specific syntax before trying again.