Solved Item attributes

  • 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!

Sep 27, 2025
15
1
3
So I really need help with item attributes I have been trying to make them for a few days now like item edit has, but it just doesn't work the tab completions aren't working or something else it's just so annoying my addons are skbee and skcrew I just want it to be like this:
/itemattribute <add/remove/clear> <attribute> <amount> <slot>
 
I usually use skbee's attribute methods, so you can save the players current held item to a variable and modify the variable in the method
 
So I really need help with item attributes I have been trying to make them for a few days now like item edit has, but it just doesn't work the tab completions aren't working or something else it's just so annoying my addons are skbee and skcrew I just want it to be like this:
/itemattribute <add/remove/clear> <attribute> <amount> <slot>
can someone PLEASE just make a very simple version of it PLEASE
 
use this to apply the attribute to the item

Code:
apply [transient] attribute modifier to %itemtypes/livingentities%:
    attribute: # Required value
    slot: # Optional value
    id: # Required value
    amount: # Required value
    operation: # Required value
and use this one to remove the attribute from the player's held item
Code:
delete gravity attribute modifier of player's tool
I will not do the logic for you, I don't want to boot up my test server. also that's the best part of coding, figuring out all the logic errors.
best of luck -Meggy_Mode
 
use this to apply the attribute to the item

Code:
apply [transient] attribute modifier to %itemtypes/livingentities%:
    attribute: # Required value
    slot: # Optional value
    id: # Required value
    amount: # Required value
    operation: # Required value
and use this one to remove the attribute from the player's held item
Code:
delete gravity attribute modifier of player's tool
I will not do the logic for you, I don't want to boot up my test server. also that's the best part of coding, figuring out all the logic errors.
best of luck -Meggy_Mode
TYSM IT WORKS FINALLY but attributes with underscores don't :emoji_frowning: i'm gonna try to fix that but thanks it says it's <none>
 
Last edited:
TYSM IT WORKS FINALLY but attributes with underscores don't :emoji_frowning: i'm gonna try to fix that but thanks it says it's <none>
this is the skript:
# ---------- ITEM ATTRIBUTE COMMAND ----------
command /itemattribute <text> <text> [<text>] [<text>]:
trigger:
if player's tool is air:
send "&cYou need to hold an item."
stop
if arg-1 is "add":
set {_attr} to arg-2 parsed as an attribute type
replace all "_" in {_attr} with " "
set {_slot} to arg-3
set {_amount} to arg-4 parsed as number
set {_id} to "minecraft:%{_attr}%"
apply attribute modifier to player's tool:
attribute: {_attr}
id: "%{_id}%"
slot: {_slot}
amount: {_amount}
operation: add_number
send "&aApplied %{_attr}% with %{_amount}% on %{_slot}% slot."
if arg-1 is "remove":
if arg-2 is not set:
send "&cUsage: /itemattribute remove <attribute>"
stop
set {_attr} to arg-2 parsed as an attribute type
replace all "_" in {_attr} with " "
delete {_attr} attribute modifier of player's tool
send "&aRemoved %{_attr}% from held item."
# ---------- ITEM ATTRIBUTE TAB COMPLETION ----------
on tab complete of "/itemattribute":
set tab completions for position 1 to "add" and "remove"
if tab arg-1 is "add" or "remove":
set tab completions for position 2 to "attack_damage", "max_health", "armor", "armor_toughness", "movement_speed", "attack_speed", "knockback_resistance", "luck", "scale", "step_height", "fall_damage_multiplier" and "gravity"
if tab arg-1 is "add":
set tab completions for position 3 to "mainhand_slot_group", "offhand_slot_group", "head_slot_group", "chest_slot_group", "legs_slot_group" and "feet_slot_group"
 
here are the attributes