1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Registering an enchanted tool recipe

Discussion in 'Skript' started by SandyVerse, Apr 15, 2017.

Thread Status:
Not open for further replies.
  1. SandyVerse

    SandyVerse Active Member

    Joined:
    Mar 19, 2017
    Messages:
    51
    Likes Received:
    0
    How would I call for an enchanted tool recipe when registering one? Ex: register new crafting recipe for iron pickaxe of efficiency 3 with (input here).
    --- Double Post Merged, Apr 16, 2017, Original Post Date: Apr 15, 2017 ---
    bump
    --- Double Post Merged, Apr 17, 2017 ---
    bump
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    You could try this:
    Code (Skript):
    1. command /newRecipe:
    2.     trigger:
    3.         set {_i} to iron pickaxe of efficiency 3
    4.         register new shape[less] recipe for {_i} using iron pickaxe, glowstone, redstone, air, air, air, air, air
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I'll try this now. Thanks!
    --- Double Post Merged, Apr 18, 2017, Original Post Date: Apr 18, 2017 ---
    Errors: ERROR Can't understand this condition/effect: register new shape recipe for {_i} using iron pickaxe, glowstone, redstone, air, air, air, air, air (Recipe.sk, line 4: register new shape recipe for {_i} using iron pickaxe, glowstone, redstone, air, air, air, air, air')
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Try to put parentheses `()` around {_i} variable
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Like this ({_i}) or (_i)?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    ({_i})
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Just tried it, no difference. Same error
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Hm. Let's try this:
    Replace the set {_i} with this
    Code (Skript):
    1. set {_i} to iron pickaxe of efficiency 3 parsed as item
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    ERROR Can't understand this expression: 'iron pickaxe of efficiency 3 parsed as item' (Recipe.sk, line 3: set {_i} to iron pickaxe of efficiency 3 parsed as item') 18.04 00:04:02 [Server] ERROR Can't understand this condition/effect: register new shaped recipe for {_i} using iron pickaxe, glowstone, redstone, air, air, air, air, air (Recipe.sk, line 4: register new shaped recipe for {_i} using iron pickaxe, glowstone, redstone, air, air, air, air, air')

    Error
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Alright, let me try this out on my test server, I'll get back to you in a minute
    --- Double Post Merged, Apr 18, 2017, Original Post Date: Apr 18, 2017 ---
    Okay I got it. Whilst doing this, I also realized that I only had 8 items set for the recipe, so that was one of the errors.
    Anyways, here is the code:
    Code (Skript):
    1. command /newRecipe:
    2.     trigger:
    3.         set {_i} to "iron pickaxe of efficiency 3" parsed as item
    4.         register new shapeless recipe for ({_i}) using iron pickaxe, air, air, air, air, air, air, air, air
    5.         send "&4[&l!&4] &rNew recipe registered for &aIron Pickaxe of Efficiency III&r."
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234

    Just for future reference, would I need to change the varible {_i} to something else (Ex: {_t} ) if I wanted multiple items to share this same formula?
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    No, you could just re-set it inside the command.
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I just tried the shapeless recipe. It works fine. I tried tweaking it to do this

    command /newRecipe:
    trigger:
    set {_i} to "iron pickaxe of efficiency 3" parsed as item
    register new shaped recipe for ({_i}) using iron ingot, iron ingot, iron ingot, air, stick, air, air, stick, air
    send "&4[&l!&4] &rNew recipe registered for &aIron Pickaxe of Efficiency III&r."

    command /oldrecipe:
    trigger:
    reset all server recipes

    and it just gives me a regular iron pickaxe. Anything I can do to make it enchanted?
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Just tested it for myself & did some research. Turns out, that Minecraft has higher demand over Plugins for crafting. That means you cannot override existing recipes. As well, your `/oldRecipe` command will reset ALL recipes on the server, meaning that if you run that command, it will not allow you to craft anything.
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    The oldrecipe command doesn't reset the recipes for me. The other thing is really disappointing. How else would I enchant a tool with efficiency 3 by crafting the vanilla way? Thanks!
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Use this instead of /oldRecipe:
    Code (Skript):
    1. command /resetRecipes:
    2.     trigger:
    3.         wipe server crafting recipes
    4.         send "&4[&l!&4] &cAll recipes cleared"
    There is no way for you to replace the vanilla crafting recipe at the moment. Sorry.
     
  17. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I've seen it on some servers that use Skript. I believe it's possible. I've crafted an iron pickaxe on these servers and it gave an efficiency 3 pick.
     
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I could quite be a plugin, or maybe there is a hidden syntax that allows to remove all recipes for a specific item or to overwrite them. I could not find anything myself, but maybe you can on the skUnity Documentation Page.
     
  19. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Try:
    Code (Skript):
    1. on craft of iron pickaxe: #Try with the prepare item craft event too
    2.     enchant event-item with efficiency 3
     
  20. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    ERROR event-item stack cannot be changed, thus it cannot be (dis)enchanted
     
Thread Status:
Not open for further replies.

Share This Page

Loading...