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: PAINT.NET example

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.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes