Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameImage
Syntaximage [id:<id>] [load [image:<image>/path:<path>]]/[save [path:<path>] [format:<format>]]/[unload]
Short DescriptionLoads, saves, and unloads images.
Full DescriptionLoads, saves, and unloads images.

With "load", specify either a file path to read from or an image object to load.
With "save", specify a file path to save the image to and a format to save the image in (e.g. "png", "jpg", "bmp"...), defaults to "png".
For both of these the starting path is "plugins/Denizen".
Use waitable syntax ("- ~image") when loading or saving from a file to avoid locking up the server during file IO, refer to Language:~waitable.

All uses of the image command must include the "id:" argument. This is any arbitrary name, as plaintext or from a tag,
to uniquely and globally identify the image object in memory. This ID can only be used by one image object at a time.
IDs are stored when "load" is used, and only removed when "unload" is used.
Related TagsNone
Usage Example
# Use to load an image from a file into memory under the id "image".
- ~image id:image load path:data/image.png
Usage Example
# Use to load an image object from a definition, draw on it, then store it back into the definition.
- define image <image[width=50;height=50;background=blue]>
- image id:to_edit load image:<[image]>
- draw id:to_edit oval x:0 y:0 width:50 height:50 color:green
# Copy the image to avoid it auto-updating with the image loaded in under that id, can skip '.copy' if this doesn't matter for your use case.
- define image <image[to_edit].copy>
Usage Example
# Use to save an image into file and unload it.
- ~image id:image save path:data/image.png
- image id:image unload
Groupimage
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/ImageCommand.java#L27