Sueta

ItemBuilder

1.8.3

Create advanced ItemStacks in one line!

·Plugin

ItemBuilder

Create advanced ItemStacks in one line!

The ItemBuilder class should work without major modification in the latest version of Spigot. However, only 1.8 to 1.10 are currently supported actively.

ItemBuilder is an API class with which you can build advanced ItemStacks in just one line. Supported features contain ItemMeta manipulation and NBT tags, even Item- & SkullMetas!

Features

  • Class, not an actual jar. You can directly implement this API in your plugin's source code.
  • Item- & SkullMeta supported.
  • NBT Tags supported (Deprecated in v1.8.3) .
  • Extra Methods like glow() implemented.
  • Highly customizeable.
  • JSON and config reading / writing.

Usage

  1. Create an instance of the ItemBuilder
    ItemBuilder builder  =   new  ItemBuilder  (  Material.  GLOWSTONE   )
  2. Set the metas you want, for example
    builder.  setDisplayname   (   "§6Glowy Glowstone"   )   ;
  3. (Optional) Access the "Unsafe" class using
    builder.  unsafe   (   )
    and set/get NBT Tags:
    builder.  unsafe   (   )  .  setString   (   "key"  ,  "value"   )   ;
  4. Get back the Bukkit ItemStack with
    builder.  build   (   )

You can also do all of these steps in just one line:

ItemStack item  =   new  ItemBuilder  (  Material.  GLOWSTONE   )  .  displayname   (   "§6Glowy Glowstone"   )  .  unsafe   (   )  .  setString   (   "key"  ,  "value"   )  .  builder   (   )  .  build   (   )   ;

How to install

  1. Click the Download Button
  2. Press CTRL + A
  3. Press CTRL + C or right click -> Copy
  4. Go into your IDE in a blank class named "ItemBuilder" and press CTRL + V or right click -> Paste
  5. Fix the package name and enjoy a working ItemBuilder class


License

The Project is licensed under the Apache License 2.0. You can view the complete license in the LICENSE file in the main root of the GitLab repo.

Issues

If you encounter problems or have suggestions, feel free to open an issue in GitLab or send me a PM here on Spigot.

Keep in mind that negative reviews due to unreported bugs or unexpected behaviour are unconstructive and demotivating. Please open an issue

Links

GitLab: https://gitlab.com/KevSlashNull/ItemBuilder

Similar projects

Plugin →