Skip to content

Having issues with the "peripheral.getType" method #2022

Closed Answered by SquidDev
MintTee asked this question in Q&A
Discussion options

You must be logged in to vote

To clarify the documentation, it's the argument that can be a table, not the return value. This means you can do both peripheral.getType("top") or peripheral.getType(peripheral.wrap("top")).

getType will return multiple values — that can be put into a table with {peripheral.getType("top")}. You can then loop over that table and look for the "inventory" string, but it's probably easier to call peripheral.hasType("top", "inventory").

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MintTee
Comment options

Answer selected by MintTee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants