Skip to content

Configuration

DSH105 edited this page Mar 4, 2014 · 14 revisions

Configuration of HoloAPI can be done in the following two files:

  • config.yml - Used for all main HoloAPI configuration
  • language.yml - Allows control over messages sent by HoloAPI

On this page, you will learn how to:

  • Configure HoloAPI to your liking
  • Set up the following prepared hologram templates for use in the plugin:

Config.yml

Options inside of this file are as follows:

Option Default value Description
primaryChatColour 3 Primary chat colour used for HoloAPI messages. Will affect language.yml when first loaded.
secondaryChatColour b Secondary chat colour used for HoloAPI messages. Will affect language.yml when first loaded.
autoUpdate false If set to true, HoloAPI will update automatically from dev.bukkit.org. See the BukkitDev page for more information on this.
checkForUpdates true If set to true, HoloAPI will check for updates from dev.bukkit.org and notify the console if one is available. See the BukkitDev page for more information on this.
verticalLineSpacing 0.25 Spacing between each line of holograms

Image and Animated Holograms

Image Holograms

The Images section of the config file can be used to control the images loaded into HoloAPI for use through both the commands and API. Only loaded images are available directly from HoloAPI.

Note: The images section is not loaded with the HoloAPI config by default, and must be created by the user.

Images MUST be placed in the images folder of the HoloAPI directory (plugins/HoloAPI/images/). This WILL NOT work unless the image is found.

The following is an example setup of an image.

images:
  myfavouriteimage:
    path: horse.png
    characterType: BLOCK
    height: 20
    type: FILE
    requiresBorder: false

The values above are as follows:

Value Explanation
path The path of the image in the images folder. (In the example, the horse.png image is located in plugins/HoloAPI/images/).
characterType Character display type of the image. Four possible options are: BLOCK, DARK, MEDIUM and LIGHT.
height Display height of the image when loaded in-game
type File type (see below for more information)
requiresBorder Some images work better with this set to true, depending on the placement of transparent pixels.

To create a hologram based on this image in-game, the command /holo create image myfavouriteimage would need to be used.


Animated Holograms

The animations section of the config.yml can be used to load in specific GIFs to use for animated holograms. As with images, only loaded animations will be available within HoloAPI.

Note: The animations section is not loaded with the HoloAPI config by default, and must be created by the user.

GIFs MUST be placed in the animaions folder of the HoloAPI directory (plugins/HoloAPI/animations/). This directory is created by default when HoloAPI is loaded for the first time

The following is an example of how to set up an animation:

images:
  myfirstanimation:
    path: myanimation.gif
    characterType: BLOCK
    height: 30
    frameRate: 10
    type: FILE
    requiresBorder: false

The values above are as follows (very similar to images):

Value Explanation
path The path of the GIF in the animations folder. (In the example, the myanimation.gif image is located in plugins/HoloAPI/animations/). This file MUST be a GIF.
characterType Character display type of the animation. Four possible options are: BLOCK, DARK, MEDIUM and LIGHT.
height Maximum display height of the animation frames
frameRate Rate of change in frames (measured in ticks, where 20 ticks is the equivalent of 1 second). In the example, the animation would show two frames per second.
type File type (see below for more information)
requiresBorder Some animations work better with this set to true, depending on the placement of transparent pixels.

File Types

Along with the support of local images, HoloAPI also provides support for loading URL images out-of-the-box. Usage of this feature is NOT recommended.

By changing the type value of an image configuration to URL, the path value becomes the HTTP address for the desired image.