Commands with an anvil

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

ALebab

New Member
Jan 25, 2022
7
0
1
So basically I am trying to make it so you rename the paper and when you click the renamed piece of paper in the anvil it makes you execute that command. Here's the code I'm working with right now. The issue is that it always says "Unknown Command" and when I have it broadcast the event item's name it broadcasts "<null>".

command /command:
trigger:
open anvil inventory named "&8&lWrite cmd here!" to player
set slot 0 of player's current inventory to paper named "ex: CMD"

on inventory click:
if name of event-inventory is "&8&lWrite cmd here!":
cancel event
if event-slot is 2:
set {_cmd} to "%name of event-item%"
broadcast {_cmd}
wait 1 tick
make player execute command {_cmd}
close player's inventory