Skip to main content

๐Ÿ’Ž First Item

Your Big First Stepโ€‹

Thanks for choosing CraftEngine - that's a smart move you won't regret! Welcome to CraftEngine's very first tutorial! I bet you're itching to create your first item already. But before we jump into that, let me walk you through how CraftEngine's config folders are organized.

tip

You can click on the folders, and don't miss the '?' next to each fileโ€”it's clickable as well!

Set Up the Folder Structureโ€‹

Go ahead and find our first_item.yml in the folder above, then create the same directory structure. Just a note - you don't need to make the pack.yml file for this tutorial.

Tips

1๏ธโƒฃ Create a tutorial folder
2๏ธโƒฃ Inside it, make a configuration folder
3๏ธโƒฃ Add a new file named first_item.yml there

Create Your First Item Configโ€‹

Now copy this config into your YML file. After saving, just run /ce reload and try getting your item with /ce item get tutorial:diamond in the game.

items:
tutorial:diamond:
material: diamond

Add Basic Item Infoโ€‹

Right now it's just a plain diamond - let's spice it up! We'll give it a custom name and description. Try this config:

items:
tutorial:diamond:
material: diamond
data:
item-name: "<blue>Shiny Diamond"
lore:
- "<!i><red>Epic Items"

tip

Donโ€™t forget to reload your config!
(Use /ce reload to apply changes)

About <!i>: It removes italic formatting (lore text is purple & italic by default).

Need help with text formatting? Check out the MiniMessage for custom styling! โœจ

Dynamic Item Renderingโ€‹

How do I update an item's description? Just use CraftEngine's special client-bound-data feature! Unlike regular data, this only shows up for players - the server won't even know it exists.

items:
tutorial:diamond:
material: diamond
client-bound-data:
item-name: "<blue>Shiny Diamond"
lore:
- "<!i><white>Common Items"

If you still have that diamond you just created, try out client-bound-data! Just trigger a server-side item update - drop it or move it in a container - and bam! Fresh new look. If it's not updating, try switching to Survival mode.

caution

client-bound-data means the server won't have the real data. If you use it for item-name, any server-side name checks will fail. Use it wisely based on your server needs.

Stuff like max_damage and attribute_modifiers shouldn't be client-bound-data. They change real server gameplay, and you'll get weird visual mismatches