Custom Items: Advanced - BoBoBalloon/InnovativeItemsDOCS GitHub Wiki

Intro

If you have not read the basic custom item page, I suggest you read it here.

Now, let's get started. As stated in the previous section, our custom item system allows for an immense amount of customization to allow server owners to build whatever item they want with our system. But there are some types of items that require a few specific options that other items don't. That very topic is what we will cover on this page. Keep in mind that these are features that work in addition to everything else that was covered in part one of items. Meaning you can use this on top of previously mentioned features.

Player Skulls

Unlike normal items, player skulls have the extra option of setting their texture to match other players. Because of this, Innovative Items provide extra support. Let's say you wanted a player skull item that had Pewdiepie's skin, that would be possible if we did this:

test-skull:
  material: 'PLAYER_HEAD'
  skull:
    player-name: 'sub2pewdiepie12'

But this leads to a problem, what if you don't care about the player, you just care about the skin, if the player you provided was to change their skin, the skull item would reflect that change. This is where the second option comes in. All skins in Minecraft are rendered via Mojang's servers, they store all the skins. So if we were to reference the URL of where Mojang is hosting the skin on the open internet, we could use that. This is where base64 comes in. Base64 is a type of encoding that converts bytes into raw text.

The base64 for the current skin by pewdiepie is this:

ewogICJ0aW1lc3RhbXAiIDogMTYyNDE5NzM0NTIxNywKICAicHJvZmlsZUlkIiA6ICJjYTk3YWY3Y2I4MDY0MWVhOWY0MTZmYWFlMDk0OTE5MCIsCiAgInByb2ZpbGVOYW1lIiA6ICJzdWIycGV3ZGllcGllMTIiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjk2NmI2OTFiNjkzZjAxODNlZDhkODE2MDE0M2ViNzk1MWExYWRkNTA4NmMxMzY3ZjdmMDY3M2Y1MzBiMjA2IgogICAgfQogIH0KfQ==

You can put that into a base64 decoder like this website here to convert it back into a raw JSON file. You can use websites like mineskin to get the base64 encoded string for the skin you want.

An example of a config using base64 for a player skull is provided below:

test-skull:
  material: 'PLAYER_HEAD'
  skull:
    base64: 'ewogICJ0aW1lc3RhbXAiIDogMTYyNDE5NzM0NTIxNywKICAicHJvZmlsZUlkIiA6ICJjYTk3YWY3Y2I4MDY0MWVhOWY0MTZmYWFlMDk0OTE5MCIsCiAgInByb2ZpbGVOYW1lIiA6ICJzdWIycGV3ZGllcGllMTIiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjk2NmI2OTFiNjkzZjAxODNlZDhkODE2MDE0M2ViNzk1MWExYWRkNTA4NmMxMzY3ZjdmMDY3M2Y1MzBiMjA2IgogICAgfQogIH0KfQ=='

If you have both the player-name field and the base64 field, the base64 field will be given priority and the player-name field will be ignored.

Please remember that this option only works when the material field is set to PLAYER_HEAD, if the material field is not set to that, the entire skull section will be ignored.

Leather Armor

Just like player skulls, leather armor has extra options that normal items don't and that's what color to dye them. Leather armor dye can be set in one of two ways. One way is to provide the name of the color of which you wish to dye the armor, but that doesn't give you much control. The second option is to provide a RGB value that is separated by commas(,). If both options are present, the plugin will prioritize the RGB value and ignore the name of the color. An example of each is provided here:

test-leather-armor:
  material: 'LEATHER_LEGGINGS'
  leather-armor:
    rgb: '200,0,0' #If this section is deleted the armor will be blue
    color: 'BLUE'

A list of valid color names can be found here. While an RGB color picker can be found here.

Also please remember that in this example, the armor will be red, not blue. This is because the RGB value overrides the color name value. The color name value only works when the RGB value is not present.

Unlike the player skull, this field will be valid as long as the material is set to one of the four pieces of leather armor, if it is not, the leather-armor section will be ignored.

Potions

Another advanced option that this plugin provides is support for custom potions. This works as long as the item is a potion, which means that it works for splash and lingering potions as well. Here is an example:

test-potion:
  material: 'POTION'
  potion:
    rgb: '245,66,158' #Potion would be red if this was not present
    color: 'RED'
    effects:
      - 'JUMP 100 2'
      - 'HEALTH_BOOST 100 99'

Just like the previously mentioned leather armor, you can set the color of potions as well. Both the names of colors and an RGB picker are linked to that section. But unlike leather armor, the potion section also provides the effects field. In each effect there must be three values, if you miss one or do not follow the syntax, a warning will be thrown in the console and the effect will fail to load. The first value is the name of the potion effect, a list of names can be found here. The second value is the duration of the effect, the time is measured in ticks. In Minecraft there are twenty ticks in one second, meaning if you want something to last three seconds the value you would put is sixty. The final value, the level of the effect, in Minecraft, levels are one level down, so if you wanted a level one effect, you would enter zero, if you wanted a level two effect, you would enter one. So if the value you enter is:

- 'JUMP 100 2'

That would mean that you want the Jump Boost effect, for it to last five seconds, and for it to be level three. As shown in the config example, you can have as many of these effects as you want per potion.

Banners

In Minecraft, banners can have custom patterns assigned to them. We provide support for these custom patterns and an example is provided below:

test-banner:
  material: 'WHITE_BANNER'
  banner:
    patterns:
      - 'TRIANGLES_BOTTOM BLUE'
      - 'MOJANG RED'

As shown above, the banner section contains the patterns section. This patterns section contains all the patterns you want to apply to the banner and the color of the pattern. As shown in the provided example, you can have as many of these patterns as you like. An example individual pattern is provided below:

- 'MOJANG RED'

The example pattern above would translate to the pattern by the name of "MOJANG" with a color of "RED". They must be separated by a space. A list of all valid patterns can be found here, while a list of all valid colors can be found here. If the material provided is not a banner, the entire banner section will be ignored.

Shields

In Minecraft, not only can banners hold patterns, but shields can also have banner patterns placed on them. InnovativeItems supports this functionality with a custom shield section. An example is provided below:

test-shield:
  material: 'SHIELD'
  shield:
    color: 'LIGHT_BLUE'
    patterns:
      - 'TRIANGLES_BOTTOM BLUE'
      - 'MOJANG RED'

The patterns section functions the same way in the shield section as it does in the banner section. As for the color field, that represents the base color of the shield that is underlying all the patterns. All valid colors can be found here.

Fireworks

In Minecraft, fireworks have a few extra options that other items do not. You can customize the particle effects when they explode, and you can customize the time it takes for them to explode. We add support for these options and an example is provided below:

test-firework:
  material: 'FIREWORK_ROCKET'
  firework:
    flight-time: 40 #in ticks that are less than or equal to 1280 and greater than or equal to 0
    effects:
      effect-one:
        flicker: true
        trail: true
        type: 'CREEPER'
        colors:
          - 'RED'
          - 'WHITE'
          - 'BLUE'
        fade-colors:
          - 'LIGHT_BLUE'
      effect-two:
        flicker: true
        trail: false
        type: 'STAR'
        colors:
          - 'YELLOW'
        fade-colors:
          - 'BLACK'

If you would like to customize your firework, add the firework section to the item. After that, you can use the "fight-time" field to customize the amount of time it takes for the firework rocket to explode. This time is in ticks and cannot be less than 0 and cannot be greater than 1280.

If you would like to customize the effects that are displayed when the firework explodes you can use the "effects" section to make as many effects as you would like. A breakdown of a single effect is provided below:

effect-one:
  flicker: true
  trail: true
  type: 'CREEPER'
  colors:
    - 'RED'
    - 'WHITE'
    - 'BLUE'
  fade-colors:
    - 'LIGHT_BLUE'

The name of this effect is "effect-one", this name does not matter and can be whatever you want. The "flicker" field determines whether you would like the effect to flicker. The "trail" field is similar to the "flicker" field, the "flicker" field determines if the effect will have a trail. The "type" field is the type of pattern the effect will appear as, a list of all firework effect types can be found here. The "colors" field is a list of colors you would like the firework to have when it explodes, a list of all colors can be found here. The "fade-colors" field is similar to the "colors" field, the only difference is these are the colors shown when the original particle effects fade away.

Final Thoughts

With all of this said, you can see how powerful the plugin is. With Innovative Items, there is very little you can't do!