VoidPlugin/VoidTeleport/src/main/kotlin/nl/voidcorp/teleportplugin/commands/SpawnCommand.kt

15 lines
532 B
Kotlin

package nl.voidcorp.teleportplugin.commands
import nl.voidcorp.mainplugin.commands.VoidCommand
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
import org.bukkit.entity.Player
class SpawnCommand : VoidCommand() {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
if ((sender is Player) && sender.hasPermission("voidteleport.spawn")) {
sender.teleport(sender.world.spawnLocation)
}
return true
}
}