Code Patterns
Copy-paste examples for common plugin tasks. Commands, events, ECS, GUI, and more.
All
225
Command
60
Damage
2
Ecs
27
Entity
5
Gui
75
Interaction
2
Inventory
4
Moderation
3
Permission
2
Player
9
Plugin
4
Storage
2
Teleport
3
Ui
22
Util
5
← Back to Patterns
java
util
Recipe Data Asset
Define crafting recipes as JSON data assets. Place in src/main/resources/Server/Item/Recipes/
Example Code
{
"Input": [
{
"ItemId": "Ingredient_Iron_Ingot",
"Quantity": 3
},
{
"ItemId": "Resource_Wood_Oak",
"Quantity": 2
}
],
"PrimaryOutput": {
"ItemId": "Tool_Pickaxe_Iron",
"Quantity": 1
},
"SecondaryOutput": null,
"BenchRequirement": [
{
"Id": "Anvil",
"Type": "Crafting",
"Categories": ["Tools", "Weapons"]
}
],
"Seconds": 3
}
Common Mistakes
Wrong ItemId names. Missing BenchRequirement. Forgetting to set IncludesAssetPack: true in manifest.