Get recipes (Looking for an addon)

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

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

YellowZaki

Member
Mar 6, 2017
24
0
0
26
Hello, I'm looking for and addon which allows me to get the recipe of an item, for example:

The recipe of a diamond block is:

diamond diamond diamond


diamond diamond diamond


diamond diamond diamond



on command /getrecipe <text>:
trigger:
set {_1} to slot 1 of arg 1's recipe
set {_2} to slot 2 of arg 1's recipe
set {_3} to slot 3 of arg 1's recipe
set {_4} to slot 4 of arg 1's recipe
set {_5} to slot 5 of arg 1's recipe
set {_6} to slot 6 of arg 1's recipe
set {_7} to slot 7 of arg 1's recipe
set {_8} to slot 8 of arg 1's recipe
set {_9} to slot 9 of arg 1's recipe
message "The recipe is:"
message ""
message "%{_1}% %{_2}% %{_3}%"
message "%{_4}% %{_5}% %{_6}%"
message "%{_7}% %{_8}% %{_9}%"



Thanks.
 
I want to know the different items needed for crafting an item, I don't need any click thing.
 
TuSKe has recipe support that might help you.
code_language.skript:
loop recipes of held item: #A item can have more than one recipe
    send "%ingredients of loop-recipe%" #It will send a list of items. It is 9 items for Shaped and Shapeless recipes, and 1 item for Furnace recipes
 
  • Like
Reactions: YellowZaki
TuSKe has recipe support that might help you.
code_language.skript:
loop recipes of held item: #A item can have more than one recipe
    send "%ingredients of loop-recipe%" #It will send a list of items. It is 9 items for Shaped and Shapeless recipes, and 1 item for Furnace recipes
But I need items one by one, how could I do that?


Edit:

I'm making this:

code_language.skript:
command /rp:
    trigger:
        loop recipes of player's tool: #A item can have more than one recipe
            set {_ingredi::*} to ingredients of loop-recipe
            loop {_ingredi::*}:
                set {_var.%loop-index%} to loop-value-2
                send "&a&l%{_var.%loop-index%}%  %loop-index%"
        send "&c&l%{_var.0}%"
        send "&c&l%{_var.1}%"
        send "&c&l%{_var.2}%"
        send "&c&l%{_var.3}%"
        send "&c&l%{_var.4}%"
        send "&c&l%{_var.5}%"
        send "&c&l%{_var.6}%"
        send "&c&l%{_var.7}%"
        send "&c&l%{_var.8}%"
        send "&c&l%{_var.9}%"
        send "&c&l%{_var.10}%"

BUG 1
When triying to get the sponge recipe (I have a custom recipe), the loop-index 1 is set 2 times: the first time with the first recipe ingredient and the second time with "wet sponge".
So I can't get properly the {_var.1}.

Others items work fine, only sponge is not correct.

BUG 2
Crafts with air are bad ordered. For example, the cobweb crafting (which is shaped) is:

string:0 + air+ string:0
air + string:0 + air
string:0 + air + string:0

But it is shown as:

string:0 + string:0+ string:0
string:0 + string:0 + <none>
<none> + <none> + <none>

The same occurs with all items (even with vanilla craftings)
 
Last edited by a moderator:
But I need items one by one, how could I do that?


Edit:

I'm making this:

code_language.skript:
command /rp:
    trigger:
        loop recipes of player's tool: #A item can have more than one recipe
            set {_ingredi::*} to ingredients of loop-recipe
            loop {_ingredi::*}:
                set {_var.%loop-index%} to loop-value-2
                send "&a&l%{_var.%loop-index%}%  %loop-index%"
        send "&c&l%{_var.0}%"
        send "&c&l%{_var.1}%"
        send "&c&l%{_var.2}%"
        send "&c&l%{_var.3}%"
        send "&c&l%{_var.4}%"
        send "&c&l%{_var.5}%"
        send "&c&l%{_var.6}%"
        send "&c&l%{_var.7}%"
        send "&c&l%{_var.8}%"
        send "&c&l%{_var.9}%"
        send "&c&l%{_var.10}%"

BUG 1
When triying to get the sponge recipe (I have a custom recipe), the loop-index 1 is set 2 times: the first time with the first recipe ingredient and the second time with "wet sponge".
So I can't get properly the {_var.1}.

Others items work fine, only sponge is not correct.

BUG 2
Crafts with air are bad ordered. For example, the cobweb crafting (which is shaped) is:

string:0 + air+ string:0
air + string:0 + air
string:0 + air + string:0

But it is shown as:

string:0 + string:0+ string:0
string:0 + string:0 + <none>
<none> + <none> + <none>

The same occurs with all items (even with vanilla craftings)
I forgot to ask, which is your server version?
 
  • Like
Reactions: YellowZaki
You will need to wait a little. 1.12 had recipes changes and it make shaped recipes 3x3 not return the air in item list, I already fixed for next update but I need to finish all stuffs before releasing.
Ok thanks you. I will compile it from GitHub.