Clojure API for Glowstone
Clojure API for Glowstone
(add-inventory player item)
(add-inventory player item n)
Add the named item to the player's inventory, or n copies of it
Add the named item to the player's inventory, or n copies of it
Map from keyword to block.Action value
Map from keyword to block.Action value
Map from keyword to BlockFace value
Map from keyword to BlockFace value
(box loc [w h d] type)
Draw a box with width, height, depth of a certain block type
Draw a box with width, height, depth of a certain block type
(chunk-manager)
(chunk-manager world)
Get the world's chunk manager
Get the world's chunk manager
(create-server config)
Create a new GlowServer based on a config
This also sets the static worldConfig field via reflection. When creating a
server directly like this (instead of via createFromArguments
) this
otherwise doesn't get set.
Create a new GlowServer based on a config This also sets the static worldConfig field via reflection. When creating a server directly like this (instead of via `createFromArguments`) this otherwise doesn't get set.
Map from keyword to EntityType value
Map from keyword to EntityType value
(fast-forward time)
Fast forward the clock, time is given in ticks, with 20 ticks per second, or 24000 ticks in a Minecraft day.
Fast forward the clock, time is given in ticks, with 20 ticks per second, or 24000 ticks in a Minecraft day.
(fly!)
(fly! player)
Set a player as allowing flight and flying. Note: doesn't seem to actually cause flying, but it does make flying possible.
Set a player as allowing flight and flying. Note: doesn't seem to actually cause flying, but it does make flying possible.
(game-mode)
(game-mode player)
Get the current game mode
Get the current game mode
(get-block loc)
Get the block at a given location
Get the block at a given location
(highest-block-at loc)
Retrieve the highest block at the given location
Retrieve the highest block at the given location
(in-front-of loc)
(in-front-of loc n)
Get the location n
blocks in front of the given location, based on the
location's direction. Polymorphic, can work with most things that have a
location.
Get the location `n` blocks in front of the given location, based on the location's direction. Polymorphic, can work with most things that have a location.
(init-registrations!)
Perform some internal wiring for Glowstone. This populates several global (static) registries
Perform some internal wiring for Glowstone. This populates several global (static) registries
(inventory player)
Get the player's inventory
Get the player's inventory
(item-stack material count)
Create an ItemStack object
Create an ItemStack object
(listen! event k f)
Listen for an event
Event is a keyword based on the event type, like :player-interact
or
:item-spawn
, k`` is a key this event is registered under, so you can
unlisten!` with the same key afterwards. Re-registering a listener with the
same event and key will replace the old listener.
See (keys
lambdaisland.witchcraft.events/events
)
for all known
events.
Listen for an event Event is a keyword based on the event type, like `:player-interact` or `:item-spawn`, `k`` is a key this event is registered under, so you can `unlisten!` with the same key afterwards. Re-registering a listener with the same event and key will replace the old listener. See `(keys `[[lambdaisland.witchcraft.events/events]]`)` for all known events.
Map from keyword to Material value
Map from keyword to Material value
(player)
(player name)
Get a player by name, or simply the first player found.
Get a player by name, or simply the first player found.
(player-chunk player)
Return the chunk the player is in
Return the chunk the player is in
For the rare API calls that really want a plugin instance
For the rare API calls that really want a plugin instance
(plugin-manager)
Get the Bukkit plugin manager
Get the Bukkit plugin manager
(x _)
(distance this that)
Get the distance between locations/vectors/entities
Get the distance between locations/vectors/entities
(add this that)
Add locations, vectors, etc. That can also be a map of :x
, :y
, :z
Add locations, vectors, etc. That can also be a map of `:x`, `:y`, `:z`
(location _)
(location _ n)
Get the location of the given object, or n
blocks in front of it.
Get the location of the given object, or `n` blocks in front of it.
(direction _)
(y _)
(yaw _)
(pitch _)
(as-vec _)
Coerce to Vector
Coerce to Vector
(world _)
Get the world for a player, by its name, by UUID, etc.
Get the world for a player, by its name, by UUID, etc.
(z _)
(material _)
(remove-inventory player item)
(remove-inventory player item n)
Remove the named items from the player's inventory, or n copies of it
Remove the named items from the player's inventory, or n copies of it
(reset-globals!)
Glowstone and Bukkit keep tons of globals, do our best to unset/reset them so it's possible to restart a server without restarting the process.
Glowstone and Bukkit keep tons of globals, do our best to unset/reset them so it's possible to restart a server without restarting the process.
(run-task f)
Schedule a task for the next server tick
Schedule a task for the next server tick
(run-task-later f ticks)
Schedule a task for after n ticks
Schedule a task for after n ticks
(send-message player msg)
Send a message to a player
Send a message to a player
(server)
Get the currently active server.
Get the currently active server.
(set-block loc material)
(set-block loc material data)
Set the block at a specific location to a specific material
Set the block at a specific location to a specific material
(set-block-direction loc dir)
Set the direction of a block, takes a keyword or BlockFace,
see block-faces
Set the direction of a block, takes a keyword or BlockFace, see [[block-faces]]
(set-blocks blocks)
Optimized way to set multiple blocks, takes a sequence of maps with :x, :y, :z, :material, and optionally :world and :data.
Optimized way to set multiple blocks, takes a sequence of maps with :x, :y, :z, :material, and optionally :world and :data.
(start!)
(start! opts)
Start a server, optionally provided with a map of config options. See [[lambdaisland.witchcraft.config/key-values]]
Start a server, optionally provided with a map of config options. See [[lambdaisland.witchcraft.config/key-values]]
(teleport loc)
(teleport entity loc)
Teleport to a given location
Teleport to a given location
Map from keyword to TreeSpecies value
Map from keyword to TreeSpecies value
(unlisten! event k)
Remove an event listener
Remove an event listener
(worlds)
(worlds s)
Get all worlds on the server
Get all worlds on the server
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close