CorePlugins Wiki
Support Discord
  • Welcome
  • Info
    • Introduction
    • Key Concepts
    • FAQ
    • Changelog
  • Usage
    • Installation
    • Configuration
    • Commands & Permissions
    • Creating Custom Items
      • Basic Item Format
      • Namespace System
    • GUI System
    • Tips/Best Practices
    • Troubleshooting
    • Languages
Powered by GitBook
On this page
  • . Why Use Namespaces?
  • 2. Directory Layout
  • 3. Creating a New Namespace
  • 4. Referencing Namespaced Items
  • 5. Default Namespace
  • 6. In-Game GUI Integration
  • 7. Tips & Best Practices
  1. Usage
  2. Creating Custom Items

Namespace System

. Why Use Namespaces?

  • Scale & Clarity: Keep weapons, tools, cosmetics, and other item sets in separate folders.

  • Collaboration: Easily share or swap out entire namespaces without touching others.

  • GUI Organization: The in-game browser lists each namespace as its own category tab.


2. Directory Layout

All namespaces live under the customs folder inside the plugin’s data folder:

plugins/CoreItems/
└── customs/
    ├── weapons/
    │   └── customs.yml
    ├── tools/
    │   └── customs.yml
    └── default/
        └── customs.yml
  • weapons/, tools/, default/, etc. are your namespaces.

  • Each namespace folder must contain a single customs.yml file with that namespace’s item definitions.


3. Creating a New Namespace

  1. Create a folder inside plugins/CoreItems/customs/.

  2. Name it for your item group (e.g., gadgets, armor, fun).

  3. Inside, add a customs.yml file.

  4. Define all items for that namespace in your new customs.yml.


4. Referencing Namespaced Items

When giving or scripting items, use the format:

<namespace> <item_key>
  • Example: weapons magic_wand

  • If you omit the namespace and haven’t set a default, CoreItems will fall back to your configured default namespace.


5. Default Namespace

  • Controlled by namespaces.default-namespace in config.yml.

  • If a user runs /coreitems give diamond_sword, CoreItems interprets it as:

    <default-namespace>:diamond_sword

6. In-Game GUI Integration

  • Running /coreitems menu opens the Namespace Selection screen.

  • Each namespace appears as an icon (folder or custom head) with its name.

  • Clicking a namespace icon loads that namespace’s item list (paginated).


7. Tips & Best Practices

  • Naming: Use clear, lowercase folder names (e.g., weapons, not MyWeapons).

  • Consistency: Keep related items together—don’t mix armor and tools in one namespace.

  • Version Control: Commit each namespace folder independently so you can roll back changes per group.


Next Steps

Proceed to Commands & Permissions if you need to script item distribution, or dive into GUI System to customize how namespaces and items display in-game.

PreviousBasic Item FormatNextGUI System

Last updated 20 days ago