Home›Games›Minecraft›Minecraft Java Commands: Enable Cheats, Give Items & Change Time
Minecraft artwork
Game Guide

Minecraft Java Commands: Enable Cheats, Give Items & Change Time

Enable Java commands through World Options, use clear command examples, and distinguish Java instructions from Bedrock syntax.

PCPlayStationXboxNintendoSandbox

Minecraft Java Commands: Enable Cheats, Give Items & Change Time

Open controller inputs →

Enable commands in current Java Edition

Mojang's Java 26.3 release notes place World Options in the pause menu. Under General, Allow Commands controls command access in your world. Personal Game Mode affects your active mode; Default Game Mode controls the world's default. Under Multiplayer, Command Access concerns joining players. An older guide telling everyone to use Open to LAN may describe an earlier menu.

This guide concerns Java. For Bedrock, use our Bedrock command setup guide. Check the version shown by your installation before following either set of instructions.

Useful command examples

Enter commands through chat with a leading slash. In the examples containing PlayerName, replace that placeholder with the intended player's actual name. These examples adapt Mojang's command overview; they are documentation-checked, not an in-game execution test.

TaskExampleWhat to check
Give an item/give PlayerName minecraft:torch 16The player name, item identifier and count.
Clear weather/weather clearCommand permission in this world.
Set daytime/time set dayIt changes world time, rather than only your view.
Find a stronghold/locate structure minecraft:strongholdRead the returned coordinates before moving.

A safer way to learn

Our recommendation is to work in a copy or disposable world. Write down the intended change and your current location. Test one simple command, read the response, and check the result before combining anything. This makes it much easier to identify which step caused an unexpected result.

A command that changes world settings can affect other players too. Confirm the server owner's rules and your permission before using it in multiplayer. A website cannot grant server permissions simply by supplying a command string.

Why a copied command fails

  • Permission problem: inspect Allow Commands or the server's access rules.
  • Syntax problem: begin with a short example and follow the suggestions shown by your installed version.
  • Wrong target: replace the player-name placeholder carefully instead of assuming another guide's sample name exists.
  • Edition mismatch: do not append Bedrock-only options to a Java command.

For game rules such as keeping inventory, the current World Options screen also provides Edit Game Rules. Use the option exposed by your installed version instead of guessing a rule identifier from another edition. Our existing keep-inventory command article explicitly documents Bedrock.

Sources checked October 15, 2026

GetCheatBeacon guides focus on legitimate gameplay information, verified codes, and practical tips. Game mechanics and promotions can change, so details may be updated over time.

More Minecraft guides