-
Notifications
You must be signed in to change notification settings - Fork 16
Configuration
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:
Options inside of this file are as follows:
Option | Default value | Description |
---|---|---|
command |
holo |
Utilising dynamic command registration, the HoloAPI command can be customised to your liking. |
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 |
The specialCharacters
section of the configuration file allows the definition of codes that are automatically translated by HoloAPI into the specified unicode character.
HoloAPI comes with the following character configuration built in:
specialCharacters:
'[x]': '2591'
'[xx]': '2592'
'[xxx]': '2593'
'[xxxx]': '2588'
'[/]': '26A1'
'[<3]': '2764'
'[:)]': '263A'
'[:(]': '2639'
'[s]': '2600'
'[*]': '2605'
Using the above configuration, placing [:)]
anywhere in a hologram will replace it with the specified special character, which in this case is a smiley face (☺︎).
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.
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:
animations:
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. |
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.
These configuration files are generated using HoloAPI v1.1.0
# +----------------------------------------------------+
# < HoloAPI Configuration File >
# < --------------------- >
# < See the HoloAPI Wiki before editing this file >
# +----------------------------------------------------+
command: holo
primaryChatColour: '3'
secondaryChatColour: b
autoUpdate: false
checkForUpdates: true
verticalLineSpacing: 0.25
timezone:
offset: 0
showZoneMarker: true
chatBubbles:
show: false
rise: true
followPlayer: false
showPlayerName: true
nameFormat: '&6&o'
displayDurationSeconds: 8
charactersPerLine: 30
distanceAbovePlayerTag: 0.5
specialCharacters:
'[x]': '2591'
'[xx]': '2592'
'[xxx]': '2593'
'[xxxx]': '2588'
'[/]': 26A1
'[<3]': '2764'
'[:)]': 263A
'[:(]': '2639'
'[s]': '2600'
'[*]': '2605'
indicators:
damage:
enable: false
format:
default: '&c'
drowning: '&b'
fire: '&4'
magic: '&5'
poison: '&2'
starvation: '&6'
thorns: '&e'
wither: '&8'
timeVisible: 4
showForPlayers: true
showForMobs: true
exp:
enable: false
format: '&a'
timeVisible: 4
potion:
enable: false
timeVisible: 4
showForPlayers: true
showForMobs: true
goldenapple:
format: '&e+ %effect%'
godapple:
format: '&e+ %effect% II'
format:
speed: '&e %effect% %amp%'
slow: '&e %effect% %amp%'
fast_digging: '&e %effect% %amp%'
slow_digging: '&e %effect% %amp%'
increase_damage: '&e %effect% %amp%'
heal: '&e %effect% %amp%'
harm: '&e %effect% %amp%'
jump: '&e %effect% %amp%'
confusion: '&e %effect% %amp%'
regeneration: '&e %effect% %amp%'
damage_resistance: '&e %effect% %amp%'
fire_resistance: '&e %effect% %amp%'
water_breathing: '&e %effect% %amp%'
invisibility: '&e %effect% %amp%'
blindness: '&e %effect% %amp%'
night_vision: '&e %effect% %amp%'
hunger: '&e %effect% %amp%'
weakness: '&e %effect% %amp%'
poison: '&e %effect% %amp%'
wither: '&e %effect% %amp%'
health_boost: '&e %effect% %amp%'
absorption: '&e %effect% %amp%'
saturation: '&e %effect% %amp%'
gainHealth:
enable: false
format: '&a'
timeVisible: 4
showForPlayers: true
showForMobs: true
# +----------------------------------------------------+
# < HoloAPI >
# < --------------------- >
# < Language Configuration File >
# +----------------------------------------------------+
update_not_available: '&3An update is not available.'
no_permission: '&3You are not permitted to do that.'
cmd_error: '&3Error for input string: &b%cmd%&3. Use &b/holo help &3for help.'
help_index_too_big: '&3Page &b%index% &3does not exist.'
in_game_only: '&3Please log in to do that.'
string_error: '&3Error parsing &b%string%&3. Please revise command arguments.'
null_player: '&b%player% &3is not online. Please try a different Player.'
int_only: '&b%string% &3must to be an integer.'
whups: '&3Whups. Something bad happened.'
configs_reloaded: '&3Configuration files reloaded.'
line_index_too_big: '&3Line &b%index% &3does not exist.'
hover_tip: '&e&oHover over to see a preview of the hologram. Click to insert teleport
command.'
url_image_loaded: '&3Custom URL image of key &b%key% loaded.'
loading_url_image: '&3Loading custom URL image of key &b%key%&3. Create hologram when
the image has finished loading.'
loading_url_animation: '&3Loading custom URL animation of key &b%key%&3. Create hologram
when the animation has finished loading.'
active_displays: '&3Active Holographic Displays:'
images_not_loaded: '&3Images are not loaded yet. Try again later.'
failed_image_load: '&3Failed to load custom image. Make sure that it is correctly
configured in &bconfig.yml&3.'
image_not_found: '&3Image &3not found. Use &b/holo build image &3to create a new image
configuration.'
hologram_not_found: '&3Hologram of ID &b%id% &3not found.'
no_active_holograms: '&3There are currently no active holographic displays.'
hologram_created: '&3Hologram of ID &b%id% &3created.'
hologram_removed_memory: '&3Hologram of ID &b%id% &3removed from memory.'
hologram_cleared_file: '&3Hologram of ID &b%id% &3cleared from file and memory.'
hologram_moved: '&3Hologram position moved.'
hologram_reload: '&3Performing manual reload of all holograms and images...'
hologram_teleport_to: '&3You have been teleported to the hologram of ID &b%id%&3.'
hologram_update_line: '&3Line &b%index% &3has been updated to &r%input%&3.'
hologram_refresh: '&3Hologram of ID &b%id% &3refreshed.'
yes_no_input_invalid: '&3Please enter either &bYes &3or &bNo&3.'
yes_no_clear_from_file: '&3Would you like to clear this hologram from the save file?
Please enter either &bYes &3or &bNo&3.'
prompt_update_line: '&3What do you want to set this line to?'
prompt_delay: '&3Enter the desired delay (in ticks) of the frames in the new animated
hologram.'
prompt_input: '&3Enter the desired lines of the new hologram. Enter &bDone &3when
finished.'
prompt_input_frames: '&3Enter the desired lines of the new animated hologram. Enter
&bDone &3when finished or &bNext &3to start building the next frame.'
prompt_input_next: '&3Added new line: &r%input%&3. Enter next line.'
prompt_input_fail: '&3Hologram lines cannot be empty. Retry or enter &bExit &3 to
cancel.'
prompt_input_invalid: '&3Input invalid.'
prompt_next_frame: '&3Frame %num% selected. Enter first line.'
hologram_not_created: '&3The hologram was not created as it was empty.'
builder_input_fail_text_image: '&3Enter a valid line type (&bText &3or &bImage&3).'
builder_input_line_data: '&3What would you like this line to say?'
builder_input_image_path: '&3What image do you want to add?'
builder_input_next_with_number: '&3Added %line% line. Enter type for next line (&bText
&3 or &bImage).'
Feel like you can make HoloAPI better? Got something awesome to contribute? We're always looking for help! Feel free to place a fork in this repository and submit a pull request!
Setting up Images and Animations
Using the API - Step by Step Code Examples
Got something to share? Or just want to talk with the creators of HoloAPI? Come join us in IRC - #dsh105
@ irc.esper.net