ItemJoin

ItemJoin

157k Downloads

Adding hover events like in json books

TheRealDadbeard opened this issue ยท 3 comments

commented

Title. Thanks :)

commented

I have somewhat added a way that you can give JSON books using ItemJoin only once by adding first-join: to the global commands section in the config.yml in the v4.6 that will be released soon.

Usage;
- 'first-join: say This is a command only executed once per world!'

Example;

#// Global Commands for ItemJoin on join, these commands are executed by console. //#
enabled-global-commands: true
enabled-worlds: world, world_nether
global-commands:
  - 'first-join: say This is a command only executed once per world, per player.

I won't be able to add full JSON support to custom ItemJoin books until v4.8 because I will have to rewrite how books are formatted.
Hopefully, this first-join feature will be able to hold you over with the command that you sent me over spigot.

commented

I have added JSON hover events for ItemJoin v4.8 and a snapshot will be pushed out containing this soon.
I have also changed how books are done with ItemJoin so there is a new cleaner formatting.

This is how JSON hover events should be formatted when creating the page line;
<hover type="text" value="%player% of course!">"What is your name?"</hover>
the value= should be what you want to see upon hovering, and the text you want to hover one goes after it in the >"stuffhere" section.

It supports placeholders as well as you can add text before or after it to make it a sentence that has hover events in the middle of it or for specific words.

Currently, I have only added the hover event but this new formatting allows me to create additional events in the future.

The pages are now listed as shown below, The 1: 2: 3:, etc represent the page numbers.

New page formatting goes as such;

    pages:
      1:
      - '&bYou can get this book on join!'
      - '&aThis book also supports &ccolor codes!'
      - ''
      - '&cHow do custom books work?'
      - ''
      - '&0You can set an &cauthor&0'
      - '&0as shown in the items.yml'
      - '&0I set it to &bItemJoin.'
      - ''
      - '<hover type="text" value="%player% of course!">"What is your name?"</hover>'
      2:
      - '&cHow do you create a new page?'
      - ''
      - '&0As displayed to the left in the items.yml'
      - '&0Use &bnewpage&0 and &cnewline&0 to create your pages.'
      - '&cnewpage &0will start the next page.'
      - '&cnewline &0will create a new line for that page.'
      - '&bItemJoin &0by RockinChaos!'

Example book;

  book-item:
    id: WRITTEN_BOOK
    slot: 6
    name: '&c&nCreating a Book'
    author: '&bItemJoin'
    lore:
      - '&7'
      - '&7This magical book is given on join!'
    pages:
      1:
      - '&bYou can get this book on join!'
      - '&aThis book also supports &ccolor codes!'
      - ''
      - '&cHow do custom books work?'
      - ''
      - '&0You can set an &cauthor&0'
      - '&0as shown in the items.yml'
      - '&0I set it to &bItemJoin.'
      - ''
      - '<hover type="text" value="%player% of course!">"What is your name?"</hover>'
      2:
      - '&cHow do you create a new page?'
      - ''
      - '&0As displayed to the left in the items.yml'
      - '&0Use &bnewpage&0 and &cnewline&0 to create your pages.'
      - '&cnewpage &0will start the next page.'
      - '&cnewline &0will create a new line for that page.'
      - '&bItemJoin &0by RockinChaos!'
    itemflags: inventory-modify, death-drops, self-drops
    triggers: join, respawn
    permission-node: 'itemjoin.book'
    enabled-worlds: world
commented

ItemJoin v4.8 has been officially released containing this feature for official usage.
You can grab it here; https://www.spigotmc.org/resources/itemjoin.12661/download?version=223327

Please read the changelog as the documentation has not been updated yet;
https://www.spigotmc.org/wiki/recent-changes