Support for holographic displays has been added.
You can now add holograms on npcs by adding a new section to the dialog:
Code (YAML):
hologram
:
# enable or disable the hologram
enabled
: true
# this will be added to the Y coordinates of npc
y-position
: 0.4
# the lines of the hologram
lines
:
- '&cJohn'
- '&e&lCLICK'
Added a 'display-name' to the dialog so it can be used in parts of the dialogs and the hologram, the placeholder is '%npc_name%', you can use it both in the dialog lines and in the hologram.
Complete example made by me:
Code (YAML):
dialogs:
npcs:
soldier:
click
: RIGHT
display-name
: Soldier
npc-id
: 0
dialog:
- 'SEND
:
&e[NPC] &b
%npc_name%&f: Hello %player_name%!'
- 'SOUND
: ENTITY_VILLAGER_YES,0.7,0.5'
- 'WAIT
: 1'
- "SEND
:
&e[NPC] &b
%npc_name%&f: You are new around here, aren't you?"
- 'SOUND
: ENTITY_VILLAGER_YES,0.7,0.6'
- 'WAIT
: 1'
- 'SEND
:
&e[NPC] &b
%npc_name%&f: I recommend going &bsouth &fto find the city.'
- 'SOUND
: ENTITY_VILLAGER_YES,1,0.4'
- 'WAIT
: 2'
- 'SEND
:
&7'
- 'SEND
:
&7 &7&lNext objective&f
: enter the city.'
- 'SOUND
: BLOCK_NOTE_PLING,1,0.1'
hologram:
enabled
: true
# Optional
y-position
: 0.4
lines
:
- '&b
%npc_name%'
- '&6&lCLICK'
Now the config.yml file won't load, that's because I didn't add anything but created the empty file, now it doesn't happen.
I expanded the api, now you can use "
CharacterDialoguePlugin.getInstance().getApi();" to get it.
Added "ALL" click type in which makes an npc's dialog run with any of the 2 mouse clicks, it was already implemented before, but now the bug is fixed.
Note: the holograms are also reloaded with the "reload" subcommand of the main command.
It took me a long time to do this even though it was simple because I had things to do besides programming.
As an approximation of what I will do for the next one, it will be placeholders to make it easier and shorter.