From e32bc04df49e16b61334d8073060d5d24fc61be0 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm <proximyst@proximyst.com> Date: Sat, 29 Apr 2017 20:42:56 +0200 Subject: [PATCH] Add example command --- .../coalesce/bukkitforclojure/example/command.clj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/com/coalesce/bukkitforclojure/example/command.clj diff --git a/src/com/coalesce/bukkitforclojure/example/command.clj b/src/com/coalesce/bukkitforclojure/example/command.clj new file mode 100644 index 0000000..a7d0e8a --- /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 -- GitLab