Liking cljdoc? Tell your friends :D

lambdaisland.witchcraft

Clojure API for Minecraft/Bukkit

Clojure API for Minecraft/Bukkit
raw docstring

*default-world*clj

source

-set-blockcljmultimethod

Server-specific set-block implementation

Server-specific set-block implementation
sourceraw docstring

-set-blockscljmultimethod

source

-set-directioncljmultimethod

source

active-itemclj

(active-item player)
source

active-potion-effectsclj

(active-potion-effects player)
source

addclj

(add this that)
(add this that & more)

Add multiple vector/location-like things together. Returns a value with the same type of the first argument.

Add multiple vector/location-like things together.
Returns a value with the same type of the first argument.
sourceraw docstring

add-inventoryclj

(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
sourceraw docstring

allow-flightclj

(allow-flight player)
(allow-flight player bool)
source

blockclj

(block block-or-loc)

Get the block at the given location, returns a Clojure map. See get-block if you need the actual block object.

Get the block at the given location, returns a Clojure map. See [[get-block]]
if you need the actual block object.
sourceraw docstring

block-actionsclj

Map from keyword to block.Action value

Map from keyword to block.Action value
sourceraw docstring

block-faceclj

(block-face kw)

Coerce to BlockFace

Use to convert keywords like :east/:west/:self to BlockFace instances. Idempotent.

Coerce to BlockFace

Use to convert keywords like :east/:west/:self to BlockFace instances. Idempotent.
sourceraw docstring

block-face-namesclj

Map from BlockFace value to keyword

Map from BlockFace value to keyword
sourceraw docstring

block-facesclj

Map from keyword to BlockFace value

Map from keyword to BlockFace value
sourceraw docstring

block-setclj

(block-set coll)
(block-set xform coll)

Create a block set, a set of maps where every :x/:y/:z value can only occur once.

Create a block set, a set of maps where every :x/:y/:z value can only occur
once.
sourceraw docstring

clear-weatherclj

(clear-weather)
(clear-weather world)

Get clear weather

Get clear weather
sourceraw docstring

create-worldclj

(create-world name opts)

Create a new world with a given name and options

  • :seed long
  • :structures? boolean
  • :hardcore? boolean
Create a new world with a given name and options

- :seed long
- :structures? boolean
- :hardcore? boolean
sourceraw docstring

default-worldclj

(default-world)

World used for commands when no explicit world is given. Uses *default-world*, or the first world on the server.

World used for commands when no explicit world is given.
Uses [[*default-world*]], or the first world on the server.
sourceraw docstring

defprintclj

(defprint type tag to-edn)
source

directionclj

(direction block-or-loc)

Get the direction of a Block, or of the block at a certain location.

Get the direction of a Block, or of the block at a certain location.
sourceraw docstring

display-nameclj

(display-name o)
source

distanceclj

(distance this that)

Get the euclidian distance between two locations. Can take various bukkit objects (Location, Block, Vector), as well as Clojure vectors [x y z] or maps {:x x :y y :z z}, and any combination thereof.

Get the euclidian distance between two locations. Can take various bukkit
objects (Location, Block, Vector), as well as Clojure vectors `[x y z]` or
maps `{:x x :y y :z z}`, and any combination thereof.
sourceraw docstring

empty-inventoryclj

(empty-inventory player)
source

EMPTY_BLOCK_SETclj

Make sure there is only one block for each coordinate in the set, and keep them sorted by x/z/y.

Make sure there is only one block for each coordinate in the set, and keep them
sorted by x/z/y.
sourceraw docstring

entity-typesclj

Map from keyword to EntityType value

Map from keyword to EntityType value
sourceraw docstring

eye-heightclj

(eye-height e)
source

eye-locationclj

(eye-location e)
source

fast-forwardclj

(fast-forward time)
(fast-forward world 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.
sourceraw docstring

fly!clj

(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.
sourceraw docstring

fly-speedclj

(fly-speed player)
source

food-levelclj

(food-level player)

Get the player's food level, a number between 0 and 20

Get the player's food level, a number between 0 and 20
sourceraw docstring

game-modeclj

(game-mode)
(game-mode player)

Get the current game mode

Get the current game mode
sourceraw docstring

game-rule-typesclj

Map from keyword to GameRule

Map from keyword to GameRule
sourceraw docstring

get-blockclj

(get-block loc)

Get the block at a given location. Idempotent.

Get the block at a given location. Idempotent.
sourceraw docstring

HasDisplayNamecljprotocol

-display-nameclj

(-display-name _)

-set-display-nameclj

(-set-display-name _ _)
source

HasItemMetacljprotocol

-item-metaclj

(-item-meta _)

-set-item-metaclj

(-set-item-meta _ _)
source

HasLocationcljprotocol

-locationclj

(-location _)

Get the location of the given object

Get the location of the given object
source

HasLorecljprotocol

-loreclj

(-lore _)

-set-loreclj

(-set-lore _ _)
source

HasWorldcljprotocol

-worldclj

(-world _)
(-world _ _)
source

HasWorldscljprotocol

-world-by-nameclj

(-world-by-name _ _)

-world-by-uuidclj

(-world-by-uuid _ _)

-worldsclj

(-worlds _)
source

healthclj

(health player)

Get the player's health, a number between 0 and 20

Get the player's health, a number between 0 and 20
sourceraw docstring

highest-block-atclj

(highest-block-at loc)

Retrieve the highest block at the given location

Retrieve the highest block at the given location
sourceraw docstring

in-front-ofclj

(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. Returns plain data.

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. Returns plain data.
sourceraw docstring

init-xmaterial!clj

(init-xmaterial!)

We can only access the XMaterial class once a Bukkit server is available

We can only access the XMaterial class once a Bukkit server is available
sourceraw docstring

inventoryclj

(inventory player)

Get the player's inventory

Get the player's inventory
sourceraw docstring

item-in-handclj

(item-in-hand entity)
source

item-in-hand-countclj

(item-in-hand-count entity)
source

item-in-hand-typeclj

(item-in-hand-type entity)
source

item-metaclj

(item-meta o)
source

item-stackclj

(item-stack material count)

Create an ItemStack object

Create an ItemStack object
sourceraw docstring

listen!clj

(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 canunlisten!` with the same key afterwards. Re-registering a listener with the same event and key will replace the old listener.

See (keyslambdaisland.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.
sourceraw docstring

locclj

(loc obj)

Get the location of a thing, as a clojure map. Can take most objects that have some kind of location, e.g. Location, Player, Vector, Block, Entity. Can also take Clojure maps or vectors, so you can use it to coerce input of unknown type.

Get the location of a thing, as a clojure map. Can take most objects that have
some kind of location, e.g. Location, Player, Vector, Block, Entity. Can also
take Clojure maps or vectors, so you can use it to coerce input of unknown
type.
sourceraw docstring

Locationclj

source

locationclj

(location o)

Get the location of the given object

Get the location of the given object
sourceraw docstring

loreclj

(lore o)
source

material-namesclj

Map from XMaterial value to keyword

Map from XMaterial value to keyword
sourceraw docstring

materialsclj

Map from keyword to XMaterial value

Map from keyword to XMaterial value
sourceraw docstring

nearby-entitiesclj

(nearby-entities entity x y z)
source

online-playersclj

(online-players)

List all online players

List all online players
sourceraw docstring

playerclj

(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.
sourceraw docstring

player-chunkclj

(player-chunk player)

Return the chunk the player is in

Return the chunk the player is in
sourceraw docstring

pluginclj

For the rare API calls that really want a plugin instance

For the rare API calls that really want a plugin instance
sourceraw docstring

plugin-managerclj

(plugin-manager)

Get the Bukkit plugin manager

Get the Bukkit plugin manager
sourceraw docstring

PolymorphicFunctionscljprotocol

xclj

(x _)

chunkclj

(chunk _)

Retrieve the chunk for a location, entity, etc.

Retrieve the chunk for a location, entity, etc.

-addclj

(-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`

yclj

(y _)

with-xyzclj

(with-xyz _ xyz)

Return the same type, but with x/y/z updated

Return the same type, but with x/y/z updated

material-dataclj

(material-data _)

direction-vecclj

(direction-vec _)

entitiesclj

(entities _)

Get the chunk's entities

Get the chunk's entities

yawclj

(yaw _)

pitchclj

(pitch _)

material-nameclj

(material-name _)

as-vecclj

(as-vec _)

Coerce to org.bukkit.util.Vector

Coerce to org.bukkit.util.Vector

zclj

(z _)

materialclj

(material _)
source

pre-flattening?clj

(pre-flattening?)
source

redo!clj

(redo!)

Redo the last build that was undone with undo!

Redo the last build that was undone with [[undo!]]
sourceraw docstring

redo-historyclj

source

remove-inventoryclj

(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
sourceraw docstring

run-taskclj

(run-task f)

Schedule a task for the next server tick

Schedule a task for the next server tick
sourceraw docstring

run-task-laterclj

(run-task-later f ticks)

Schedule a task for after n ticks

Schedule a task for after n ticks
sourceraw docstring

schedulerclj

(scheduler)

The Bukkit scheduler

The Bukkit scheduler
sourceraw docstring

send-messageclj

(send-message p message)

Send a chat message to a specific player

Takes strings or vectors (markup), e.g.

[:red "hello " [:underline "world"]]

See [[markup/codes]].

Send a chat message to a specific player

Takes strings or vectors (markup), e.g.

```
[:red "hello " [:underline "world"]]
```

See [[markup/codes]].
sourceraw docstring

send-titleclj

(send-title p title)
(send-title p title subtitle)

Send a title and optionally subtitle to the player

Titles are splashed in big type over the middle of the screen, before they fade out.

Takes strings or vectors (markup), e.g.

[:red "hello " [:underline "world"]]

See [[markup/codes]].

Send a title and optionally subtitle to the player

Titles are splashed in big type over the middle of the screen, before they
fade out.

Takes strings or vectors (markup), e.g.

```
[:red "hello " [:underline "world"]]
```

See [[markup/codes]].
sourceraw docstring

serverclj

(server)

Get the currently active server.

Get the currently active server.
sourceraw docstring

server-typeclj

source

set-bed-spawn-locationclj

(set-bed-spawn-location player loc)
(set-bed-spawn-location player loc force?)

Set the location where the player will respawn, set force? to true to update the spawn location even if there is no valid bed available.

Set the location where the player will respawn, set `force?` to true to update
the spawn location even if there is no valid bed available.
sourceraw docstring

set-blockclj

(set-block loc)
(set-block loc material)

Set the block at a specific location to a specific material

material can be a keyword (see materials), a String like RED_WOOL or WOOL:14, a bukkit Material, a Bukkit ItemStack, or an xseries XMaterial.

Set the block at a specific location to a specific material

`material` can be a keyword (see [[materials]]), a String like `RED_WOOL` or
`WOOL:14`, a bukkit Material, a Bukkit ItemStack, or an xseries XMaterial.
sourceraw docstring

set-blocksclj

(set-blocks blocks)
(set-blocks blocks {:keys [keep-history?]})

Set blocks in bulk

Takes a sequence of maps with :x, :y, :z, :material, and optionally :world and :data.

Currently only optimized on Glowstone, elsewhere it repeatedly calls set-block

Set blocks in bulk

Takes a sequence of maps with :x, :y, :z, :material, and optionally :world
and :data.

Currently only optimized on Glowstone, elsewhere it repeatedly calls [[set-block]]
sourceraw docstring

set-directionclj

(set-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]]
sourceraw docstring

set-display-nameclj

(set-display-name o name)
source

set-fly-speedclj

(set-fly-speed player speed)
source

set-food-levelclj

(set-food-level player food-level)

Set the player's food level, a number between 0 and 20

Set the player's food level, a number between 0 and 20
sourceraw docstring

set-game-ruleclj

(set-game-rule wrld kw bool)

Set a game rule like :do-daylight-cycle or :do-insomnia. See (keys wc/game-rule-types) for all options

Set a game rule like `:do-daylight-cycle` or `:do-insomnia`.
See `(keys wc/game-rule-types)` for all options
sourceraw docstring

set-game-rulesclj

(set-game-rules world m)

Set multiple game rules like :do-daylight-cycle or :do-insomnia. See (keys wc/game-rule-types) for all options. Takes a map from keyword to bool.

Set multiple game rules like `:do-daylight-cycle` or `:do-insomnia`.
See `(keys wc/game-rule-types)` for all options. Takes a map from keyword to
bool.
sourceraw docstring

set-healthclj

(set-health player health)

Set the player's health, a number between 0 and 20

Set the player's health, a number between 0 and 20
sourceraw docstring

set-item-metaclj

(set-item-meta o im)
source

set-loreclj

(set-lore o lore)
source

set-timeclj

(set-time time)
(set-time world time)

Set the time in a world, or the first world on the current server. Time is given in ticks, with 20 ticks per second, or 24000 ticks in a Minecraft day.

Set the time in a world, or the first world on the current server.
Time is given in ticks, with 20 ticks per second, or 24000 ticks in a
Minecraft day.
sourceraw docstring

spawnclj

(spawn loc entity)

Spawn a new entity

Spawn a new entity
sourceraw docstring

start-glowstone!clj

(start-glowstone! & args)

Start an embedded Glowstone server

Optionally provided with a map of config options. See [[lambdaisland.witchcraft.config/key-values]]

Start an embedded Glowstone server

Optionally provided with a map of config options.
See [[lambdaisland.witchcraft.config/key-values]]
sourceraw docstring

start-paper!clj

(start-paper! & [gui?])

Start an embedded PaperMC server

Start an embedded PaperMC server
sourceraw docstring

stop!clj

(stop!)

Stop the embedded server

Stop the embedded server
sourceraw docstring

teleportclj

(teleport loc)
(teleport entity l)

Teleport to a given location

Teleport to a given location
sourceraw docstring

timeclj

(time)
(time world)

Get the current time in the world in ticks.

Get the current time in the world in ticks.
sourceraw docstring

tree-speciesclj

Map from keyword to TreeSpecies value

Map from keyword to TreeSpecies value
sourceraw docstring

undo!clj

(undo!)

Undo the last build. Can be repeated to undo multiple builds.

Undo the last build. Can be repeated to undo multiple builds.
sourceraw docstring

undo-historyclj

source

unlisten!clj

(unlisten! event k)

Remove an event listener

Remove an event listener
sourceraw docstring

vec3clj

(vec3 x y z)

Create a org.bukkit.util.Vector instance

Create a org.bukkit.util.Vector instance
sourceraw docstring

worldclj

(world o)
(world o n)

Get the world associated with a given object, or look up a world by string or UUID.

Get the world associated with a given object, or look up a world by string or
UUID.
sourceraw docstring

world-creatorclj

(world-creator name opts)
source

worldsclj

(worlds)
(worlds o)

Get all worlds

Get all worlds
sourceraw docstring

xmaterialclj

(xmaterial m)

Get an XMaterial instance from a keyword, string, Material, or ItemStack, or anything else for which the polymorphic [[material]] method is implemented.

This is a shim class which provides version-independent material handling.

Get an XMaterial instance from a keyword, string, Material, or ItemStack, or
anything else for which the polymorphic [[material]] method is implemented.

This is a shim class which provides version-independent material handling.
sourceraw docstring

xyzclj

(xyz o)

Get the x/y/z values of an object as a vector, can work with maps containing :x/:y/:z keys, or virtually any Glowstone object that encodes or has a location.

Get the x/y/z values of an object as a vector, can work with maps containing
`:x`/`:y`/`:z` keys, or virtually any Glowstone object that encodes or has a
location.
sourceraw docstring

xyz1clj

(xyz1 o)

Like xyz, but add an extra 1 at the end, for affine transformations

Like [[xyz]], but add an extra `1` at the end, for affine transformations
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close