Skip to content

API & Dependencies

Jacob edited this page Sep 23, 2019 · 3 revisions

If you have any questions about anything feel free to contact me through spigot or join our discord!
All plugins listed below are optional and are NOT required, ItemJoin has absolutely no required dependencies and can run independently.


ItemJoin's Custom API?

ItemJoin does in-fact allow other plugins to hook into it if needed. All API options are located under me.RockinChaos.itemjoin.api.ItemJoinAPI. There is currently only one method; me.RockinChaos.itemjoin.api.ItemJoinAPI.getItems(player). You can as a plugin developer give all ItemJoin items to a player by hooking into ItemJoin's new API.

You can see all available methods here; Available Methods. If you wish to see a method added feel free to submit a request on GitHub!

How does TokenEnchant work?

Currently, using TokenEnchant on your server gives you access to the following;

You can add any Custom Enchantment to the correct/corresponding item it is allowed to be placed on, TokenEnchants work the same way as regular/default Minecraft enchants for ItemJoin it just simply piggybacks off the already created system.

Using the already provided enchantments identifier you can create an item with several TokenEnchantments as such; enchantment: TokenEnchantName:PowerLevel, TokenEnchantName:PowerLevel, TokenEnchantName:PowerLevel, TokenEnchantName:PowerLevel

You can even use regular Minecraft enchantments at the same time for example; enchantment: EXPLOSIVE:3, DISK:2, ARROW_DAMAGE:3, DAMAGE_ALL:5

As you can see I have two token enchantments as well as two default Minecraft enchantments all on one item. The first two enchants as you can see are the token enchantments.

Here is an example of these enchants on an item;

items:
  any-text:
    id: BOW
    slot: 0
    enchantment: EXPLOSIVE:3, DISK:2, ARROW_DAMAGE:3, DAMAGE_ALL:5
    enabled-worlds: world_name_here, another_world_name

How does PlaceholderAPI work?

How do Placeholders work? ItemJoin supports PlaceholderAPI, meaning it can hook into the plugin and use those placeholders! You can use ANY of these placeholders, in all parts of ItemJoin. Such as skull-owner, name, lore, book pages, commands, cooldown-messages, and more! Placeholders will be supported by all parts of ItemJoin!!

If you do not use PlaceholderAPI, ItemJoin currently only has two placeholders by default; which is %player% and %hitplayer%. This will be expanded upon in the future but it is highly recommended that you use PlaceholderAPI, as it is so useful and has so many features!

How does WorldGuard work?

How can I get items in a certain region?

ItemJoin supports WorldGuard, meaning that you can hook into the plugin and use certain regions. If you want to receive items upon entering, joining, respawning into that region it's really simple. Items that are given upon entering the region will be removed upon exiting it. Do note that ItemJoin supports any version of WorldGuard, both the old WorldGuard API and the new WorldGuard API introduced in Minecraft v1.13

You have to simply add WorldGuard to your server, then set the enabled-regions per item, you can set multiple regions separated by commas. Lastly, you have to set the triggers to region-enter. You can make your items multipurpose saying you can receive them on join anywhere but you can also get them when entering a region, see the available triggers above to set up more than just a region-enter trigger.

Here is an example of several items you can get when entering/joining into/respawning into region1 and region2;

items:
 first-item:
   id: SKULL_ITEM
   slot: 0
   triggers: region-enter
   enabled-regions: region1, region2
 second-item:
   id: DIAMOND_SWORD
   slot: Arbitrary
   triggers: region-enter
   enabled-regions: region1, region2
 helmet-item:
   id: DIAMOND_HELMET
   slot: Helmet
   triggers: region-enter
   enabled-regions: region1, region2
 chestplate-item:
   id: 299
   slot: Chestplate
   triggers: region-enter, join, respawn, world-change
   enabled-regions: region1, region2
 leggings-item:
   id: DIAMOND_LEGGINGS
   slot: Leggings
   triggers: region-enter, join, respawn, world-change
   enabled-regions: region1, region2
 boots-item:
   id: LEATHER_BOOTS
   slot: Boots
   triggers: region-enter
   enabled-regions: region1, region2

How can I remove items when entering a certain region?

Using the settings for getting the items when entering a region all you have to do to remove an item when entering a region is to add the region-remove trigger. It is pretty simple, you can also remove certain items in specific regions as well as give certain items in specific regions at the same time.

This will remove the item upon entering a region listed under enabled-regions on the item then give the item back upon exiting the region.

Example of removing items;

items:
 first-item:
   id: SKULL_ITEM
   slot: 0
   triggers: region-remove
   enabled-regions: region1, region2
 second-item:
   id: DIAMOND_SWORD
   slot: Arbitrary
   triggers: region-remove
   enabled-regions: region1, region2

How does HeadDatabase work?

HeadDatabase is pretty simple to set up, this allows access to a whole lot of head textures, just add the plugin to your server.

The only thing you have to do to get a custom HeadDatabase skull is to set the id of the item to SKULL_ITEM and add the line skull-texture: 'hdb-<head id>'.

Example;

items:
  skull-item:
    id: SKULL_ITEM
    slot: 0
    skull-texture: 'hdb-4320'
    enabled-worlds: world, world_nether, world_the_end

How does Vault work?

You can hook into Vault to use your economy on ItemJoin's commands. Vault can be used to define the cost of running and ItemJoin command, and if you do not have enough in your balance you will receive an error message. This is one of the most simple API's to use. Simply add commands-cost: # to the item you want to charge a cost for running that command. Now every time a player runs that command it will attempt to withdraw that amount from their balance. In the example item below the user is charged $25 from their economy balance for sending themselves a message.

Example;

items:
  ultra-item:
    id: DIAMOND_SWORD
    slot: 0
    commands:
      multi-click:
        - 'message: &eYou were just charged to send yourself a message... How do you feel..?'
    commands-type: interact
    commands-cost: 25
    enabled-worlds: world

How does AuthMe work?

There is nothing here that the user needs to configure. Items will be given after the player types the login command and fully registers to AuthMe.

How does Multiverse-Core work?

There is nothing here that the user needs to configure. This is only used for Multiverse-Inventories. ItemJoin already has multi-world support without this.

How does Multiverse-Inventories work?

There is nothing here that the user needs to configure. Easily set world inventories using ItemJoin. You can make it so you get the items on join and world change without clearing the player's inventory! Very helpful with ItemJoin inventory management.

How does PerWorldInventory work?

There is nothing here that the user needs to configure. Easily set world inventories using ItemJoin. You can make it so you get the items on join and world change without clearing the player's inventory! Very helpful with ItemJoin inventory management. I have recently seen this plugin start to pop up everywhere and it seems like an amazing alternative to Multiverse-Inventories.

How does PerWorldPlugins work?

There is nothing here that the user needs to configure. It is not recommended to use this since ItemJoin is disabled in any world that is not defined under world-list but, ItemJoin does support PerWorldPlugins if you happen to have it running on your server for some reason and ItemJoin will be disabled in worlds that are not allowed by PerWorldPlugins and will not have any conflictions or errors.

How does xInventories work?

There is nothing here that the user needs to configure. Easily set world inventories using ItemJoin. You can make it so you get the items on join and world change without clearing the player's inventory! Very helpful with ItemJoin inventory management.

How does MyWorlds work?

There is nothing here that the user needs to configure. This is similar to Multiverse-Core, it will allow easy multi-world support, no real benefit or harm to ItemJoin.

How does BetterNick work?

There is nothing here that the user needs to configure. This allows ItemJoin to easily find your original player name and UUID if you are nicknamed using BetterNick.

You can’t perform that action at this time.