ItemData
What is "ItemData"?
Well, I want the users of this plugin to be able to create all kinds of existing items with enchantments/potioneffects/durability etc.
In order to do this I thought about something completely new: ItemData.
It is very easy to work with ItemData.
All you need is a list of attributes of the item you want to create. The order of the attributes does not matter at all.
If your ItemData contains mistakes BossShop will log them in the "BugFinder.yml" file.
ItemData should contain at least two things: Type/id and amount.
- 'type:STONE' - amount:10
or
- 'id:1' - amount:10
There are many different kinds of attributes you can use:
id:<number>
This defines the Material of the item. For example 1 = Stone, 49 = Obsidian, 278 = Diamond pickaxe.
You can find a list of IDs here: Link
type:<type>
Type defines the Material too. You can either use id or type.
You can find a list of types here: Link
amount:<number>
This should be clear.
durability:<number>
Durability does different things. For example it defines the damage of Armor/Weapons/Tools and it defines the color of wool.
name:<name>
This is the displayed name of the item.
Supported placeholders: Link
lore:<line1#line2#line3>
This is the lore of the item.
You can use color codes like &4 (=DARK_RED) or &l (= BOLD).
You can "switch" to the next line using "#".
Supported placeholders: Link
Both following ways allow you to create lores:
A) (traditional) item: - 'name:Name of item' - 'lore:Line 1#Line 2#Line 3' B) (new) item: - 'name:Name of item' - 'lore:Line 1' - 'lore:Line 2' - 'lore:Line 3'
enchantment:<enchantment name>#<level>
Use this attribute to enchant your item.
Example: enchantment:DAMAGE_ALL#5 <- This would add Sharpness V to your item.
Here you can find a list of Enchantments: Link
enchantmentid:<enchantment id>#<level>
Use this attribute to enchant your item.
Example: enchantmentid:16#5 <- This would add Sharpness V to your item.
Here you can find a list of Enchantments: Link
color:<red number>#<green number>#<blue number>
Use this attribute to dye your item.
Example: color:110#10#140
How does it work? Well, just define how red/green/blue the color shall be. You can find a list of RGB colors here: http://www.farb-tabelle.de/de/farbtabelle.htm
And you can actually mix this RGB colors with programs like Paint.NET too:
potioneffect:<potion name>#<level>#<time in seconds>
This allows you to add PotionEffects to items. WARNING: You can only use this attribute at potions! Example: potioneffect:STRENGTH#1#600 <- This would add a strength II potion effect which would last 10 minutes. Here you can find a list of PotionEffects: Link
playerhead:<name>
This allows you to set the name of Skulls. WARNING: You can only use this attribute at skulls ("SKULL_ITEM"). Example: playerhead:Herobrine <- This would transform the Head into a Herobrine head. IMPORTANT: In order to get Playerheads you need to set the material to SKULL_ITEM ("type:SKULL_ITEM") AND the durability has to be 3 ("durability:3").
hideflags:<flag1#flag2#flag3>
Fast way to hide flags. Examples:
- hideflags:all
- hideflags:HIDE_ATTRIBUTES
- hideflags:HIDE_ATTRIBUTES#HIDE_ENCHANTS
Here you get a list of available flag names: Link
Unbreakable
Makes the item completely unbreakable. Useful for adventure maps for example.
banner:<>
Feature already implemented. Guide cooming soon.
Important:
Just one thing might be a little bit confusing: Lists of items (/ItemData).
One item (/ItemData) looks like this:
- type:POTION - amount:1 - durability:0 - name:&1NinjaPotion - 'lore:&e1 NinjaPotion #&cPrice: 400 Money #&cOnly for VIPs!' - potioneffect:SPEED#4#600 - potioneffect:JUMP#0#600 - potioneffect:NIGHT_VISION#0#600
and a list of items (/ItemData) looks like this:
- - type:WOOL - amount:10 - durability:14 - - type:WOOL - amount:10 - durability:11 - - type:WOOL - amount:10 - durability:4 - - type:WOOL - amount:10 - durability:5
It's just a list, which contains different ItemDatas. And this ItemDatas are lists too.
A MenuItem ALWAYS is one single item. One single ItemData (= List of attributes). BUT if you choose "Item" as reward/price it ALWAYS is a list of ItemData (=A list which contains lists of attributes).
For example if you want 1 Diamond as price, then it would look like this:
Price: - - type:DIAMOND - amount:1
Structure:
Price:
- List of Items
- ItemData 1
- ItemData 2
- ItemData 3
- ItemData 4
&
Price:
- List of Items
- ItemData 1
Note: In BossShop it is not possible to have to completely identical items within one shop due to the way the plugin parses and stores the shopitems. If you want identical items a possible workaround is adding invisible text to your items, like for example color codes at the end of your item displayname or lore, to make it different. The issue has been solved in BossShopPro because of its improved structure and a new way of managing shopitems.
I'm trying to put this in my shop but it won't show up
Please help!
@ThePikaBomber Try It Now... You Forgot to add ''
I want to set the price of an item to be any player head but i can't, how can i?
Edit: Found it, it's okay..
I want to set reward-item to playerhead:%player% Any chance to implement this?
Any way to modify item attributes, such as damage, health or movement speed?
Also Name variables aren't working, or i couldn't get them to work:
Current config on the ingot:
BalanceIgnot:
RewardType: playercommand
PriceType: free
Reward: balance
MenuItem:
- type:gold_ingot
- amount:1
- 'name:&rPlayer balance: &6%balance%'
InventoryLocation: 9
Message: '' "
I search for a possibility to set MenuItem for specific playerheads based on a command like that:
This creates a head with oaklog-texture based on Mojangs skindatabase instead of a real playername/-uuid so you can use a lot of different heads without the need of such an amount of accounts.
@Androkai
Try this Androkia: (I use this in my BossShop for player heads, in particular the head of the player)
PlayerHead:
RewardType: command
PriceType: points
Price: 35
Reward: give %player% 397:3 1 player:%player%
MenuItem:
- type:SKULL_ITEM
- durability:3
- playerhead:%player%
- amount:1
- name:&aYour very own Head!
- 'lore:&cPrice: 35 Points'
Message: '&eYou bought &9Your own Head! &ePoints left: &2%left%'
InventoryLocation: 23
ExtraPermission: ''
@Julius700
Julius700,
You have to manually add the name of the item via the "- NAME:" tag. (The spot you are showing the player balance)
If you wish to still show the player balance, you can use the "- LORE:" tag or the " -MESSAGE:" tag to show the player's balance.
Here is an example I have in my shop: (I use LORE to show the cost and I use the MESSAGE tag to show <in the chat> how many points they have left. This should work just fine for money balance as well.
PickofFaith:
RewardType: item
PriceType: points
Price: 90
Reward:
- - type:DIAMOND_PICKAXE
- amount:1
- name:&o&3Pick of Faith
- 'lore:&9Forged by the Titans'
- enchantmentid:34#3
- enchantmentid:32#2
- enchantmentid:35#4
MenuItem:
- type:DIAMOND_PICKAXE
- amount:1
- name:&3Pick of Faith
- 'lore:&cPrice: 90 Points'
- amount:1
- enchantmentid:34#3
- enchantmentid:32#2
- enchantmentid:35#4
Message: '&eYou bought the &9Pick of Faith! &ePoints left: &2%left%'
InventoryLocation: 12
ExtraPermission: ''
GOOD LUCK and I hope this helps!
I'm looking for the same thing Androkai mentioned below for a MenuItem, using the SkullOwner and texture metadata from a database. Is there a way to input this info into the ItemData? Just using the playerhead:%player% doesn't work, as it won't recognize the metadata. (To clarify, I have some awesome items from another plugin that I'm trying to stock as inventory in my shops, but the items are specially-textured skulls, not actual player heads. I really want the MenuItem to match the actual item the player will receive when they purchase it, rather than just being a generic placeholder.)
@Sarianna82
Please implement this! I would love that option
How would I create different types of wood? It seems that the functionality for items with the same id is absent, or at least I cannot find any documentation/examples of it. Can anyone please explain this to me?