Get anvil name

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

JuliHatSpaB

Member
Aug 18, 2023
47
1
8
I want to let the user type something into the text field of an anvil GUI and then use this value later in the script but how do I get the text in this text field?
 
Hello,
i know what you are trying to achive but i really recommend you do this with a command or any chat based input because first,
it is hard to do, second you have a limit on how long the inputted text can be in the anvil gui, and third, i would say that using a chat based input is more stable.
 
I want to let the user type something into the text field of an anvil GUI and then use this value later in the script but how do I get the text in this text field?
Done.

Code:
on inventory click:
    type of event-inventory is anvil inventory
    add anvil text input of event-inventory to {text::%player's uuid%::*}
 
command /textinput:
    trigger:
        loop {text::%player's uuid%::*}:
            set {_text} to {text::%player's uuid%::%loop-index%}
            send "input ## %loop-index%: %player% - %{_text}%"

the /textinput command is only used as an example of how to use this.

(Keep in mind, the player has to actually click an inventory slot for this to work.)
 
  • Like
Reactions: JuliHatSpaB
Done.

Code:
on inventory click:
    type of event-inventory is anvil inventory
    add anvil text input of event-inventory to {text::%player's uuid%::*}
 
command /textinput:
    trigger:
        loop {text::%player's uuid%::*}:
            set {_text} to {text::%player's uuid%::%loop-index%}
            send "input ## %loop-index%: %player% - %{_text}%"

the /textinput command is only used as an example of how to use this.

(Keep in mind, the player has to actually click an inventory slot for this to work.)
Tank you for the reply!
But it's not working. I've tried to put this in my code but it won't word this way and your code also don't works...
An example of what I've tried (because I'm maybe just very dumb XD):
1. copy code, save, reload...
2. place anvil
3. open anvil an put a random item in the first slot
4. renamed the item
5. took the renamed item out
6. repeated this process multiple times
7. /textinput but there was no output :emoji_frowning:
 
Hello,
i know what you are trying to achive but i really recommend you do this with a command or any chat based input because first,
it is hard to do, second you have a limit on how long the inputted text can be in the anvil gui, and third, i would say that using a chat based input is more stable.
It's for a complex home script where you can put in the maximum homes in that way. I don't think somebody would need more then the anvil limit. I unterstand why you think chat is better but I think with an anvil it's much cooler...
 
It's for a complex home script where you can put in the maximum homes in that way. I don't think somebody would need more then the anvil limit. I unterstand why you think chat is better but I think with an anvil it's much cooler...
Like I said, you needed to rename an item for it to work.