Skip to content

this is a questies #774

Answered by fatboychummy
zaze06 asked this question in Q&A
Apr 26, 2021 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

I'm assuming you're looking at how to check if an item in a chest or etc is not in a blacklist?

If so, initialize a table of all the item identifiers which are "bad" (this may change between versions), then you will want to loop through the inventory and the items to check if:

  • On each slot, is there an item that is blacklisted?

Something like this might work (you will need to modify it). My code assumes 1.12.2 with Plethora (as I've not had too much of a chance to mess with 1.16), so if you're on newer versions of mc, some of the code may need to be different.

local blacklist = {
  ["minecraft:dirt:0"] = true, -- these strings are in the format "modid:blockid:damage"
  ["minecraft:stone:0"

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@zaze06
Comment options

@Lupus590
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

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

This discussion was converted from issue #773 on April 26, 2021 20:09.