How to Create Custom Items on Your Minecraft Server (Commands Guide)
Guide

How to Create Custom Items on Your Minecraft Server (Commands Guide)

Create custom weapons, tools, and gear with special names, enchantments, and attributes using Minecraft commands. A complete guide to the /give command and NBT syntax.

Swelis TeamApril 24, 202610 min read

Your players want legendary weapons. The kind with glowing purple names, lore text that tells a story, and Sharpness levels that would make an enchanting table weep. The problem is that vanilla enchanting caps out fast, and there is no in-game way to name an item "Blade of the Fallen King" with custom stats.

That is where the /give command comes in. With the right syntax, you can create items that have any enchantment at any level, custom display names with colors, multi-line lore, modified attack damage and speed, and even the unbreakable flag so they never need repairs.

This guide covers the modern component syntax introduced in Minecraft 1.20.5, which replaced the older NBT tag format. If you are running a 1.21+ server (which you should be — see what changed in 26.1.2), this is the syntax you need.


The /give Command Basics

The /give command hands an item directly to a player's inventory. The basic structure is:

/give <target> <item>[<components>] [count]
PartWhat it doesExample
<target>Who receives the item@p (nearest player), @a (all players), PlayerName
<item>The item IDminecraft:diamond_sword, diamond_sword
[<components>]Optional data components[custom_name="My Sword"]
[count]How many to give1, 64

A simple example that gives yourself a diamond sword:

/give @s diamond_sword

To give every player on the server 16 golden apples:

/give @a golden_apple 16

The @s selector means "the entity running the command" — which is you if you type it in chat, or a command block if the command block runs it. The @p selector means the nearest player, and @a means all players currently online.

You need operator permissions to use /give. If you are not op, ask your server admin or check out the LuckPerms guide for setting up permission nodes. On most servers, the permission node is minecraft.command.give.


Custom Names and Lore

The first thing most admins want is a custom item name — something like "Excalibur" instead of "Diamond Sword". In the 1.20.5+ component syntax, you use custom_name:

/give @s diamond_sword[custom_name="Excalibur"]

That creates a sword named "Excalibur" in white italic text (the default styling for custom names).

Adding Colors and Formatting

To add colors, you use JSON text formatting inside the name. The syntax wraps your text in a JSON object:

/give @s diamond_sword[custom_name='{"text":"Excalibur","color":"gold","bold":true}']

Notice the quotes: single quotes wrap the entire JSON value, and double quotes are used inside the JSON. This avoids escaping headaches.

Available colors include black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, and white. You can also use hex codes like "color":"#FF5733".

Formatting options include bold, italic, underlined, strikethrough, and obfuscated (the glitchy text effect).

Adding Lore

Lore is the gray text that appears below the item name in the tooltip. It uses the lore component with a list of text lines:

/give @s diamond_sword[custom_name='{"text":"Excalibur","color":"gold"}',lore=['{"text":"Forged in dragon fire","color":"gray","italic":false}','{"text":"Wielded by kings","color":"dark_purple","italic":false}']]

Each line in the lore list is its own JSON text object. By default, lore text is italic — if you want normal text, set "italic":false explicitly.

Here is a more readable breakdown of that command:

/give @s diamond_sword[
  custom_name='{"text":"Excalibur","color":"gold"}',
  lore=[
    '{"text":"Forged in dragon fire","color":"gray","italic":false}',
    '{"text":"Wielded by kings","color":"dark_purple","italic":false}'
  ]
]

You cannot actually break the command across lines in-game — this is just for clarity. When you type it, it needs to be one continuous line.


Enchantments Beyond the Table

Enchanting tables max out at level 30, and even with bookshelves you cannot get Sharpness V on most items. Commands have no such limits.

The enchantments component lets you add any enchantment at any level:

/give @s diamond_sword[enchantments={levels:{sharpness:10}}]

That creates a diamond sword with Sharpness X — double the maximum obtainable level.

Stacking Multiple Enchantments

Add multiple enchantments by listing them inside the levels object:

/give @s diamond_sword[enchantments={levels:{sharpness:10,looting:5,fire_aspect:3,sweeping_edge:5}}]

Normally Incompatible Enchantments

In vanilla survival, you cannot combine Sharpness with Smite or Bane of Arthropods. Commands do not care:

/give @s diamond_sword[enchantments={levels:{sharpness:5,smite:5,bane_of_arthropods:5}}]

This creates a sword that deals bonus damage to everything — undead, arthropods, and regular mobs alike.

Enchantment Level Limits

There is technically no hard cap on enchantment levels in commands, but effects stop scaling at certain points. Sharpness adds 0.5 + (level × 0.5) damage per level, so Sharpness 255 would add 128 damage per hit. Protection caps its damage reduction around level 20 for most purposes. Experiment to find what feels right for your server.

The Enchantment Glint

If you want an item to have the enchantment shimmer but no actual enchantments, you can use the enchantment_glint_override component:

/give @s stick[enchantment_glint_override=true,custom_name='{"text":"Magic Wand","color":"light_purple"}']

This creates a glowing stick with no mechanical enchantments — useful for cosmetic items or quest rewards.


Attributes and Modifiers

Enchantments modify damage through bonus effects, but attributes modify the base stats themselves. The attribute_modifiers component lets you change attack damage, attack speed, armor, movement speed, and more.

Attack Damage

A vanilla diamond sword has 7 base attack damage. To create a sword that deals 20 damage per hit:

/give @s diamond_sword[attribute_modifiers=[{type:"attack_damage",amount:20,operation:"replace_base",slot:"mainhand",id:"minecraft:base_attack_damage"}]]

The operation field matters:

  • replace_base — sets the stat to exactly that number
  • add_value — adds to the existing value
  • add_multiplied_base — multiplies the base value (0.5 = +50%)
  • add_multiplied_total — multiplies the final value after all other modifiers

Attack Speed

Axes swing slowly, swords swing faster. You can make a weapon swing at any speed:

/give @s diamond_sword[attribute_modifiers=[{type:"attack_damage",amount:15,operation:"replace_base",slot:"mainhand",id:"minecraft:custom_damage"},{type:"attack_speed",amount:4,operation:"replace_base",slot:"mainhand",id:"minecraft:custom_speed"}]]

Attack speed of 4 means 4 swings per second — the same as a sword's default. An attack speed of 1.6 is an axe. Higher values make the weapon swing faster.

Movement Speed on Boots

You can make armor that increases (or decreases) movement speed:

/give @s diamond_boots[attribute_modifiers=[{type:"movement_speed",amount:0.3,operation:"add_multiplied_base",slot:"feet",id:"minecraft:speed_boots"}]]

This adds 30% movement speed when the boots are equipped.

Knockback Resistance

Want to make armor that prevents knockback entirely?

/give @s diamond_chestplate[attribute_modifiers=[{type:"knockback_resistance",amount:1,operation:"add_value",slot:"chest",id:"minecraft:knockback_armor"}]]

A knockback resistance of 1 means 100% knockback resistance — the player will not be pushed by attacks.


Unbreakable Items and Hide Flags

Making Items Unbreakable

The unbreakable component creates tools that never lose durability:

/give @s diamond_pickaxe[unbreakable={}]

By default, the item tooltip will show "Unbreakable" in blue text. If you want to hide that:

/give @s diamond_pickaxe[unbreakable={show_in_tooltip:false}]

Hiding Attribute and Enchantment Tooltips

Sometimes you want a clean item tooltip without the list of enchantments or attributes. The enchantments and attribute_modifiers components both have a show_in_tooltip option:

/give @s diamond_sword[enchantments={levels:{sharpness:10},show_in_tooltip:false}]

This creates a Sharpness X sword that does not display the enchantment in the tooltip — it just looks like a normal diamond sword until someone gets hit by it.

Combining Everything

Here is a full example combining custom name, lore, enchantments, attributes, and unbreakable:

/give @s netherite_sword[custom_name='{"text":"Godslayer","color":"dark_red","bold":true}',lore=['{"text":"Forged from the bones of the Ender Dragon","color":"gray","italic":false}','{"text":"Damage: 50 | Unbreakable","color":"dark_gray","italic":false}'],enchantments={levels:{sharpness:10,fire_aspect:3,looting:5},show_in_tooltip:false},attribute_modifiers=[{type:"attack_damage",amount:50,operation:"replace_base",slot:"mainhand",id:"minecraft:godslayer_damage"}],unbreakable={show_in_tooltip:false}]

That creates a netherite sword named "Godslayer" with hidden Sharpness X, Fire Aspect III, and Looting V, plus 50 base attack damage, and it never breaks. The lore tells players what it does since the enchantments are hidden.


Command Blocks for Distribution

Typing these commands manually every time is tedious. Command blocks let you automate item distribution.

Getting a Command Block

Command blocks are not obtainable in survival. Use:

/give @s command_block

Place it, right-click to open the interface, and paste your /give command. Set the command block to "Needs Redstone" or "Always Active" depending on how you want to trigger it.

Kit System Example

Suppose you want to give players a starter kit when they step on a pressure plate. Place a command block under the pressure plate and use:

/give @p diamond_sword[custom_name='{"text":"Starter Sword","color":"green"}'] 1

The @p targets the nearest player — which will be whoever triggered the pressure plate.

For multiple items, you need multiple command blocks chained together, or you can use functions. Functions are text files that run multiple commands in sequence — see the datapacks guide for how to set those up.

Reward Chests with Loot Tables

For more complex reward systems, consider using loot tables instead of raw /give commands. Loot tables let you define random item pools with weighted chances. You can trigger them with /loot give @p loot your_namespace:reward_chest.

However, loot tables require datapacks and JSON files. If you just need to give specific items to specific players, command blocks with /give are simpler.

Restricting Who Can Use Commands

If you want only certain ranks to trigger command blocks, combine them with permission checks. LuckPerms and similar plugins can gate command execution. Alternatively, use scoreboard objectives to track whether a player has already received a kit and prevent duplicates.

Check the console commands cheat sheet for scoreboard syntax.


Troubleshooting

"Unknown or incomplete command"

You probably have a syntax error — mismatched brackets, missing commas, or wrong quote types. The most common issues:

  • Components use square brackets [], not curly braces {}
  • JSON text uses curly braces {} inside the component
  • Use single quotes around JSON text to avoid escaping double quotes
  • No spaces between component name and =

"Invalid NBT tag"

If you see references to NBT in the error, you might be using pre-1.20.5 syntax on a modern server. The old syntax looked like:

/give @s diamond_sword{display:{Name:'{"text":"Old Sword"}'}}

The new syntax (1.20.5+) is:

/give @s diamond_sword[custom_name='{"text":"New Sword"}']

The Item Has No Effects

Some enchantments only work on specific item types. Sharpness only affects swords and axes. Infinity only affects bows. If you put the wrong enchantment on an item, it will show in the tooltip but do nothing.

Commands Are Too Long

The chat limit is 256 characters. For complex items, use a command block (which has a 32,767 character limit) or a function file (no practical limit).


Quick Reference

ComponentPurposeExample
custom_nameDisplay namecustom_name='{"text":"Name","color":"gold"}'
loreTooltip text lineslore=['{"text":"Line 1"}','{"text":"Line 2"}']
enchantmentsEnchantment listenchantments={levels:{sharpness:5,looting:3}}
attribute_modifiersStat changesattribute_modifiers=[{type:"attack_damage",amount:20,operation:"replace_base",slot:"mainhand",id:"minecraft:custom"}]
unbreakableNo durability lossunbreakable={} or unbreakable={show_in_tooltip:false}
enchantment_glint_overrideForce glint on/offenchantment_glint_override=true

Common enchantment IDs: sharpness, smite, bane_of_arthropods, fire_aspect, looting, sweeping_edge, knockback, unbreaking, mending, efficiency, fortune, silk_touch, protection, feather_falling, infinity, power.

Common attribute types: attack_damage, attack_speed, armor, armor_toughness, knockback_resistance, movement_speed, max_health.


Ready to Start Your Adventure?

Join lots of users already enjoying lag-free hosting.

Launch Your Server
Swelis Hosting

Premium Minecraft server hosting starting at €1.50/GB RAM. Experience lightning-fast performance, 24/7 support, and 99.9% uptime guarantee.

© 2026 Swelis International e.U. All rights reserved.