
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.
Minecraft Java Commands: Enable Cheats, Give Items & Change Time
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.
| Task | Example | What to check |
|---|---|---|
| Give an item | /give PlayerName minecraft:torch 16 | The player name, item identifier and count. |
| Clear weather | /weather clear | Command permission in this world. |
| Set daytime | /time set day | It changes world time, rather than only your view. |
| Find a stronghold | /locate structure minecraft:stronghold | Read 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.