Updated:

Make an item shimmer (no enchantments)

/give @p minecraft:nether_star[enchantment_glint_override=true]

On Java 1.20.5+, add the glint without any enchantment, which suits tickets and prize items. With a name too: [enchantment_glint_override=true,custom_name="Special Ticket"] (see custom items).

/give @p minecraft:diamond_sword[enchantments={sharpness:5},enchantment_glint_override=false]

Set it to false to hide the glint on an enchanted item.

On 1.20.4 and older, the usual trick was an empty enchantment list: {Enchantments:[{}]}.

Outline mobs and players (Glowing)

/effect give @e[type=minecraft:cow,distance=..20] minecraft:glowing 30 0 true

The Glowing effect draws a white outline that shows through walls, for 30 seconds here. Use infinite to keep it on.

/data merge entity @e[type=minecraft:cow,limit=1,sort=nearest] {Glowing:1b}

For mobs you can also set the Glowing:1b tag. Unlike the effect, it never wears off until you set Glowing:0b. Player data cannot be changed with /data, so use the effect for players (see the data command).

Change the outline color

/team add red
/team modify red color red
/team join red @e[type=minecraft:cow,limit=1,sort=nearest]

The outline takes the color of the target's team. Color teams red and blue and players can tell friend from foe through walls (see the team command).

Ideas

Turn it off

/effect clear @a minecraft:glowing
/data merge entity @e[type=minecraft:cow,limit=1,sort=nearest] {Glowing:0b}

Bedrock Edition

Bedrock has neither the Glowing effect nor a glint-only option. To make an item shimmer, give it a real enchantment with /enchant.

Common problems

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.