// File: kubejs/server_scripts/botania_id_command.js
ServerEvents.commandRegistry(event => {
    const { commands: Commands, arguments: Arguments } = event;
    event.register(
        Commands.literal('botaniaids')
            .executes(ctx => {
                let botaniaIds = [];
                try {
                    Item.list.forEach(item => {
                        if (item.id.startsWith('botania:')) {
                            botaniaIds.push(`'${item.id}',`);
                        }
                    });
                    ctx.getSource().getPlayer().tell(`Found ${botaniaIds.length} Botania Item IDs:\n${botaniaIds.join('\n')}`);
                    console.log(`Found ${botaniaIds.length} Botania Item IDs:\n${botaniaIds.join('\n')}`);
                    if (botaniaIds.length === 0) {
                        console.error('No Botania items found! Is Botania installed?');
                    }
                    return 1;
                } catch (e) {
                    console.error('Error in botaniaids command: ' + e);
                    return 0;
                }
            })
    );
});