Craft Manager

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

TPGamesNL

Staff member
Moderator
Supporter
Addon Developer
Dev Programme
Jan 20, 2018
1,501
108
63
21
About this script:
This script adds support for simple custom recipes to your scripts.

How simple is this?
All you have to do to make a custom recipe is this (example):
Code:
on load: # Doesn't have to be in a load event
    register shaped recipe with (gold ore, gold ore, gold ore, gold ore, coal, gold ore, gold ore, gold ore, gold ore) and result 8 gold ingot
Result:
4380_dd9aab346a4682c6d20377947dfac6ea.gif


How to use:
Create shaped recipe:
Code:
register [new] shaped recipe with [items] %items% [(and|with)] result %item%
create [new] shaped recipe with [items] %items% [(and|with)] result %item%
Create shapeless recipe:
Code:
register [new] shapeless recipe with [items] %items% [(and|with)] result %item%
create [new] shapeless recipe with [items] %items% [(and|with)] result %item%
Delete all custom recipes:
Code:
delete [all] custom recipes
remove [all] custom recipes

Requirements:
- skript-mirror
- Skript (at least 2.2-dev36)

DIS SCRIPT NO WORK:
If the script doesn't work, contact me on Discord: TPGamesNL#0880.
You can also PM me on the forums if you prefer that.
If you have any other questions/suggestions, feel free to ask, I'd like to help you.
If you want me to make a script for you, contact me.
 
Last edited:
Hey, Its cool seeing someone posting this, but I have to give some feedback

1) It seems very VERY over convoluted, recipes are VERY simple to make, and this code is much much toooooo long for a simple recipe. Like for example, your 20 or so lines to remove air? You don't need to remove air. In the Bukkit recipe manager, any ingredient that is not set, is automatically set to air. Take a look at my snippet HERE, its substantially shorter.

2) ""# Getting NamespacedKey (some sort of ID I think)"" <-- you're on the right track, it is an ID but it should not be random, as you are doing here by having it, and here is why:
- The namespace key is used to unlock the recipe to the player, since recipes are not automatically unlocked for players, you need to either do it in your plugin, or via commands in game, here's an example from one of my plugins:

Screen Shot 2019-04-29 at 9.15.33 PM.png


"survivalplus" is the name of the plugin, so with yours it'll show as "Skript" and then it will be followed with a hash key.
Now running the command "/recipe give playername ..." you would have a list of a hashed recipes and the user wouldn't be able to know what the recipe is.

I recommend allowing the skripter to pick the name of the ID (see my snippet) so that they can unlock it in game.
 
First of all, thanks for the feedback! I appreciate it.
1) I did this for a reason, let me show you: when you use the code `register shaped recipe with (air, stick, air, air, stick, air, air, air, air) and result 8 gold ingot`, it will create a recipe with this result:
upload_2019-4-30_9-15-51.png

And that's good, that's what it should do, but I wanted something extra:
upload_2019-4-30_9-16-49.png

without removing the air, the second image wouldn't have been possible, but I did want this (it's in default Minecraft recipes too). There might be another way to do it, but if I don't remove the air like I do it in my code, the second image won't work (I also tested that with your snippet, but it would only do the first image).
2) Thanks for this information, I totally forgot about the recipe unlock system, and I had no idea what the NamespacedKey was for (should've looked more into it). I'll be releasing an update for this soon.

Thanks again for the feedback!
PS You forgot a [ /CODE ] on your snippet, look under Custom Furnace Recipe
 
  • Like
Reactions: ShaneBee