Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

DeluxeMenus add-on #39

Description

@Dreygz

Hello everyone! Please help me finish the addon to DeluxeMenus, because most of the servers use this plugin and I think it is useful for users

credits = 'Chorus';
version = '1.0.0';
description = 'This add-on brings Deluxemenus support to Chorus by loading GUIs from selection.'
image = 'https://i.imgur.com/U3wp1qq.png'

function onInit() {
    const format = new GUIFormat(
        function getName(map) {
            return settings ? settings.get('menu_title') : 'No title';
        },
        function getRows(map) {
            return settings ? settings.get('size') : 1;
        },
        function getItems(map) {
            const items = [];
            map.keySet().forEach(key => {
                if (key = 'items') {
                    const itemSection = map.get(key);
                    let item = itemSection.get('ID');
                    if(!item) item = itemSection.get('material'); // If ID is not found, look for MATERIAL
                    item = item ? item.toString().split(",")[0] : item.toString(); // Remove amounts (wool:3, 10 -> wool:3)
                    const itemName = item ? item.indexOf(':') != -1 ? item.split(':')[0] : item : 'BEDROCK'; // If item is null, use Bedrock. Otherwise, remove meta
                    const position = itemSection.get('slot');

                    items.push(new GUIFormatItem(new GUIFormatPosition(position), itemName));
                }
			});
            return items;
        });
    format.setActive('DeluxeMenus');
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions