Skip to content

Adding a New Item (Basic Setup)

⚠️ This is only the very basic setup and does not provide any functionality yet.


At first, select which item you want to add to the project.

Example: In this guide, we want to add the Shovel item.


Before we can create our struct, we need to check how to name it properly.

Go to the file:

steel-core/build/classes.json

Search for strings similar to the name of the Item you want to implement in this file. In our example:

  • We find ShovelItem

This means we need two different structs to manage both items.


Now create your class in:

steel-core/src/behavior/items/

TODO: If you read it please read in #termonology if there is something fixed Be as descriptive as possible with the file name. For our example:

  • `shovel.rs

Add the struct like this to your file:

/steel-core/src/behavior/items/shovel.rs
pub struct ShovelBehavior;
impl ItemBehavior for ShovelBehavior {}

⚠️ This is only the basic setup and doesn’t give any functionality yet!


To register the item, there needs to be the attribute `item_behavior added!

/steel-core/src/behavior/items/shovel.rs
#[item_behavior(class = "ShovelItem")]
pub struct ShovelBehavior;
impl ItemBehavior for ShovelBehavior {}

⚠️ More complex items than the shovel have properties, you can find more information here more information!


Now press compile and let Rust (and our configuration) do some magic!

After compilation, your item should appear in:

steel-core/src/behavior/generated/items.rs

You can go there and use Ctrl + F to search for your item name.

If your item is still missing:

  1. Delete the generated folder

  2. Run:

    cargo clean
  3. Compile again

This should solve the problem.


Like already said, at this point the item does nothing.

To add behavior, you need to implement the necessary methods in ItemBehavior in your file (e.g. shovel.rs).

👉 I would recommend looking at other item implementations to check which have similar item functionality as your item.


  • using properties for blocks and items, you can find information here