setClass

open fun setClass(player: Player, @KeyPattern.Value classId: String, @KeyPattern.Value slotId: String?): Boolean(source)

Sets the class with classId in the slot with slotId, or in the slot chosen by your plugin if slotId is null. Do the same as your plugin's admin command changing the class, with its usual side effects. Check that classId is one of your classes, and that the class can be held in the slot.

Return

true if the change was requested, false if it is unsupported for this player, class and slot, or the player's data isn't loaded. Return true even if the plugin may cancel the change through its events.