diff --git a/src/com/coalesce/bukkitforclojure/example/command.clj b/src/com/coalesce/bukkitforclojure/example/command.clj new file mode 100644 index 0000000000000000000000000000000000000000..a7d0e8a981aa438fd36b9fcda57a85f5704987d0 --- /dev/null +++ b/src/com/coalesce/bukkitforclojure/example/command.clj @@ -0,0 +1,15 @@ +(ns com.coalesce.bukkitforclojure.example.command + (:import [org.bukkit.command CommandSender Command] + [org.bukkit.entity Player] + [org.bukkit Sound])) + +(defn clojureCommand + [^CommandSender sender + ^Command command + ^String label + #^"[Ljava.lang.String;" args] + (.sendMessage sender "You successfully ran a command in Clojure.") + (if (instance? Player sender) + (let [player (cast Player sender)] + (.playSound player (.getLocation player) (Sound/BLOCK_NOTE_BASEDRUM) 1.0 1.0))) + ) \ No newline at end of file