Skip to content
CmdrDats edited this page Dec 30, 2012 · 1 revision

Bukkit Utilities

(:require [cljminecraft.bukkit :as bk])

Source: bukkit.clj

Bukkit Docs: http://wiki.bukkit.org/Scheduler_Programming

Description

Contains a lot of the core static entry points into the Bukkit API - Most could be reached by traversing the object tree through your plugin instance, but being able to use (bk/server) instead of (.getServer plugin) leads to cleaner code and less stuff to pass around.

The other half of this is the Scheduler programming convenience functions that lets you setup a ui-sync task, delayed-task, repeated-task and lets you cancel-task, check if it's a running-task? or a queued-task?.

Usage

A typical usage of example is that of delaying some kind of action, maybe for 10 seconds:

(bk/delayed-task plugin #(plr/send-msg "Bob" "Hello") (bk/seconds-to-ticks 10))

Most of the other functions you can just eyeball at the source. They're fairly straightforward.

Clone this wiki locally