Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Dustpuppy

How to craft items in ae2 network

Recommended Posts

Hi again,

here a short code that explains, how to craft an item from an ae2 system. Simply connect an adapter to the me-controller and have the pattern in the system setup.

local component = require("component")
local me_controller = component.me_controller

local amount = 1
local selection = "minecraft:stick"

local craftables = me_controller.getCraftables({name = selection})

if craftables.n >= 1 then			-- at least one entry found
  craftables = craftables[1]			-- set craftables to first entry in list
  local retVal = craftables.request(amount)	-- request to craft item(s)
end


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.