aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/examplemod/commands/ExampleCommand.kt
blob: 12538cafe533a7ac6325d797982c0637118f4f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.examplemod.commands

import ExampleMod
import com.examplemod.config.Config
import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender
import net.minecraft.util.ChatComponentText
import net.minecraft.util.IChatComponent

class ExampleCommand : CommandBase() {
    override fun getCommandName() = "examplemod"

    override fun getCommandAliases() = listOf("example")

    override fun getCommandUsage(sender: ICommandSender?) = "/$commandName"

    override fun getRequiredPermissionLevel() = 0

    override fun processCommand(sender: ICommandSender?, args: Array<out String>?) {
        sender?.addChatMessage(ChatComponentText("Example command run!"))
        ExampleMod.currentGui = Config.gui()
    }
}