-
Notifications
You must be signed in to change notification settings - Fork 37
API & Dependencies
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 does in-fact allow other plugins to hook into it if needed. All API options are located under me.RockinChaos.itemjoin.api.ItemJoinAPI
.
Example of the API usage;
ItemJoinAPI itemAPI = new ItemJoinAPI();
itemAPI.getItems(player);
itemAPI.isCustom(item);
itemAPI.isCustom(item, world);
You can as a plugin developer, give all custom items to a player by hooking into ItemJoin's new API.
There are A LOT of available API methods and more are constantly being added. 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!
If you are using ItemJoin's API, you first have to import it into your project.
To import ItemJoin, simply add the following code to your pom.xml Replace {VERSION} with the version with the current release or snapshot version. This should look like 5.0.6-RELEASE
or 5.0.7-SNAPSHOT
as an example.
<repositories>
<!--CraftationGaming Repository-->
<repository>
<id>CraftationGaming-chaos</id>
<url>https://repo.craftationgaming.com/chaos</url>
</repository>
</repositories>
<dependencies>
<!--ItemJoin API-->
<dependency>
<groupId>me.RockinChaos.itemjoin</groupId>
<artifactId>ItemJoin</artifactId>
<version>{VERSION}</version>
<scope>provided</scope>
</dependency>
</dependencies>
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?
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: PLAYER_HEAD
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
You can also set it so you only get items upon entering the region for the first time, or the first time per world, and the first time per life.
Example;
triggers: region-enter, first-join
-- The item will be given only for the first time the player enters the region.
triggers: region-enter, first-world
-- The item will be given each time the player enters the region per-world, (once per world).
triggers: region-enter, first-life
-- The item will be given each time the player enters the region after they die, (once per life).
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: PLAYER_HEAD
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 PLAYER_HEAD
for Minecraft versions above 1.13 or SKULL_ITEM
for Minecraft versions BELOW 1.13 and add the line skull-texture: 'hdb-<head id>'
.
Example;
items:
skull-item:
id: PLAYER_HEAD
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 SkinRestorer work?
There is nothing here that the user needs to configure, this should automatically fix and player heads given by ItemJoin.
How does Citizens work?
There is nothing here that the user needs to configure. This will simply prevent NPC players from receiving custom items.
How does ChestSort work?
There is nothing here that the user needs to configure.
This prevents custom items with the inventory-modify
itemflag or the global Prevent.itemMovement:true
from having the items sorted in the player's inventory.
How does Hyperverse work?
There is nothing here that the user needs to configure.
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 ProtocolLib work?
There is nothing here that the user needs to configure, this should automatically fix any bugs when handling crafting items. I highly suggest using ProtocolLib as it may resolve any issues you experience with the crafting slot items!
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.
Please see the documentation page if you need any help with these new updates!
If you have any ideas or requests that you would like to see in this plugins future please submit a feature request.