Need help getting /give to work through execute console 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!

Hyparingle

Member
Jul 25, 2025
2
0
1
I am trying to make a command that gives me a coin item.

Code:
command /coin:
    trigger:
        execute console command "minecraft:give %player% gold_nugget[custom_name=[{"text":"Coin","italic":false,"color":"gold"}],enchantments={flame:1},unbreakable={},tooltip_display={hidden_components:[enchantments]}]"

The /give command works on its own when I paste it into console and use it in-game but as soon as I try to execute it in Skript it doesnt work. The closest I could get that does work is:

Code:
execute console command "minecraft:give %player% gold_nugget[custom_name=test]"

however as soon as I add formatting and other stuff it doesn't work.


Thanks in advance to anyone who might help.
------------------------
Server Version: 1.21.5
Skript Version: 2.12.0
SkBee Version: 3.11.3
 
I am trying to make a command that gives me a coin item.

Code:
command /coin:
    trigger:
        execute console command "minecraft:give %player% gold_nugget[custom_name=[{"text":"Coin","italic":false,"color":"gold"}],enchantments={flame:1},unbreakable={},tooltip_display={hidden_components:[enchantments]}]"

The /give command works on its own when I paste it into console and use it in-game but as soon as I try to execute it in Skript it doesnt work. The closest I could get that does work is:

Code:
execute console command "minecraft:give %player% gold_nugget[custom_name=test]"

however as soon as I add formatting and other stuff it doesn't work.


Thanks in advance to anyone who might help.
------------------------
Server Version: 1.21.5
Skript Version: 2.12.0
SkBee Version: 3.11.3

yea that wont work.
Perhaps you can try this alternative?:

CSS:
command /specialcoin <player>:
    executable by: console
    trigger:
        set {_item} to gold nugget  
        set {_item} to {_item} with item flag hide enchants
        enchant {_item} with unbreaking 1
        give arg-1 {_item} named "&6Coin"

you can simply use

execute console command "specialcoin <playername>"
 
This helps a lot because I couldn't find out how to hide the enchants however I need the item that this command gives to stack with coins that come from minecraft:give %player% gold_nugget[custom_name=[{"text":"Coin","italic":false,"color":"gold"}],enchantments={flame:1},unbreakable={},tooltip_display={hidden_components:[enchantments]}] meaning they have to be identical.

Thank you for the code though I will use this if I really have to, I will just have to replace all the coins on my server to the Skript one and not the /give one.