Subject: Help Needed with Skript Command

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Cos

Member
Apr 25, 2025
4
0
1
Hello everyone,


I am working on a Skript plugin and I need some assistance. I am trying to create a command /box item <type> <level> <amount> <name> <material>, which generates items with enchantments and custom names.


Here’s what I need the command to do:


  • <type> can be: sword, axe, pickaxe, helmet, chestplate, leggings, boots.
  • <level> refers to the enchantment level (e.g., sharpness 2 for a sword, efficiency 2 for a pickaxe, etc.).
  • <amount> specifies how many items with different enchantment levels will be generated (e.g., if level is 3 and amount is 4, the player should get 4 items with protection 3, protection 4, protection 5, protection 6).
  • <name> is the name of the item, which will be displayed in the player's inventory.
  • <material> is the type of material for the item (e.g., diamond, iron, wood).

The command should also assign enchantments like Sharpness, Efficiency, or Protection to the item and assign different enchantment levels based on the amount. The items should be added to the player's inventory with custom names that include stars (☆1, ☆2, etc.).


Unfortunately, I am having trouble with a few parts, such as creating the items correctly, adding enchantments, and handling the gradient text in the item names.


Could someone help me with this or point out what I am doing wrong?


Thank you in advance!
 
Hello everyone,


I am working on a Skript plugin and I need some assistance. I am trying to create a command /box item <type> <level> <amount> <name> <material>, which generates items with enchantments and custom names.


Here’s what I need the command to do:


  • <type> can be: sword, axe, pickaxe, helmet, chestplate, leggings, boots.
  • <level> refers to the enchantment level (e.g., sharpness 2 for a sword, efficiency 2 for a pickaxe, etc.).
  • <amount> specifies how many items with different enchantment levels will be generated (e.g., if level is 3 and amount is 4, the player should get 4 items with protection 3, protection 4, protection 5, protection 6).
  • <name> is the name of the item, which will be displayed in the player's inventory.
  • <material> is the type of material for the item (e.g., diamond, iron, wood).

The command should also assign enchantments like Sharpness, Efficiency, or Protection to the item and assign different enchantment levels based on the amount. The items should be added to the player's inventory with custom names that include stars (☆1, ☆2, etc.).


Unfortunately, I am having trouble with a few parts, such as creating the items correctly, adding enchantments, and handling the gradient text in the item names.


Could someone help me with this or point out what I am doing wrong?


Thank you in advance!
I would make sure that your command is taking the proper values and applying them to your items properly. Ie: If argument 1 is a text and is meant for an enchantment, you won't be able to enchant an item with it without parsing it first. I would make sure you're parsing items/types properly. As for gradients, you can use rgb.birdflop for a simple generator for them, you can also use this resource to generate gradients more easily: https://forums.skunity.com/threads/colorutils-1-16-skript-2-6.12134/. Also, feel free to share the parts of your code that aren't working and me or others could point out how to fix issues with it.