Modern namespaced IDs are recommended. This numerical form is only for old Java releases.
/give @p 345 1
Give command syntax by version
Java 1.13+
/give @p minecraft:compass 1
Namespaced ID (current format)
Java 1.8–1.12.2
/give @p 345 1 0
Numerical ID + data value
Bedrock Edition
/give @p minecraft:compass 1
Same namespaced ID (namespace optional)
Rows appear only when the underlying value is verified: the Java 1.8–1.12.2 row requires a reviewed historical numerical ID, and the Bedrock row appears only when this exact namespaced ID exists in the Bedrock registry.
How to Get Compass
Crafting Recipe
Iron Ingot
Iron Ingot
Redstone Dust
Iron Ingot
Iron Ingot
Crafting table recipe — makes 1 × Compass.
More Ways to Get It
Craft a Compass from four iron ingots and one Redstone Dust. In the Overworld it points toward the world spawn unless it is bound to a lodestone.
Collect four iron ingots and Redstone Dust.
Craft the Compass at a Crafting Table.
Use it for basic navigation or bind it to a lodestone when applicable.
Quick answer: Use minecraft:compass in Java Edition commands. Craft a compass from four iron ingots and one redstone dust; it points to your world spawn by default, to a lodestone when bound, and spins uselessly in the Nether and End.
Spawn pointing and its limits
A plain compass always points toward world spawn, not your bed. If your base sits near spawn it works as a homing device; if you settled thousands of blocks away, the needle leads you to the world origin instead.
In the Nether and the End, regular compasses spin randomly and are useless. The item only finds its purpose across dimensions when bound to a lodestone.
Crafting: 4 iron ingots + 1 redstone dust.
Points to world spawn, not to your bed.
Spinning needle means wrong dimension or no lodestone link.
Lodestone and recovery variants
Use a compass on a lodestone, or combine them at a smithing table, and the compass locks onto that block forever, working in any dimension. Explorers carry one pointing home; server players hide lodestones as secret waypoints.
The recovery compass is the other variant: eight echo shards around a compass crafts one that points to your last death spot, the tool for corpse runs after unlucky endings.
Compass Command Examples
Give 1 to nearest player: /give @p minecraft:compass 1
Give 1 to yourself: /give @s minecraft:compass 1
Give to a specific player: /give PlayerName minecraft:compass 1
Use time and direction tools together during long expeditions.
Compass FAQ
What is the item ID for Compass?
The item ID for Compass is minecraft:compass. Java Edition commands such as /give, /clear, and /setblock use this namespaced ID.
What is the numerical ID for Compass?
Compass has the historical numerical ID 345, used in Java Edition 1.12.2 and earlier. Current versions use minecraft:compass instead.
How do I give myself Compass in Minecraft?
Open the chat window and run /give @p minecraft:compass 1 to give the nearest player one Compass. Replace @p with a player name to target someone else.
How many Compass can stack in one slot?
Compass stacks up to 64 per inventory slot.
How do you craft Compass?
Compass is crafted on a crafting table with 4 iron ingots and 1 redstone dust, which yields 1 Compass.
How do you make a compass point to your base?
Place a lodestone at your base and use the compass on it, or combine the two at a smithing table. The lodestone compass then points to that block in any dimension, replacing the default spawn pointing.
Why is my compass spinning in Minecraft?
Regular compasses spin in the Nether and the End because spawn pointing only works in the Overworld. A lodestone compass spins only if its lodestone has been broken or is in another dimension.
Does a compass point to your bed?
No. A plain compass points to world spawn, the place where you first appeared in the world. For bed-level navigation, bind a compass to a lodestone placed next to your bed instead.
Sources and Data Review
Item facts were reviewed for Java Edition 26.2 on .