How to check player inventory for items/blocks with custom tags

Started by Slashventures on

Topic category: Help with MCreator software

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check player inventory for items/blocks with custom tags

Howdy, I have created a custom tag which contains over a dozen blocks, I have called it: heavy

What I am trying to do is have minecraft check if player has said tagged blocks tagged as "heavy" in their inventory and apply a slowness effect to them.

I am not sure where to begin, all I know is I want.

"If player has blocks with tag "heavy'

do: Apply potion effect: Slowness to player

I've found several things I think I can use, I'm just unsure of how to use them in a way that works for what I'm trying to do.

EG: "Has ___ In inventory"

"Is __ tagged in item tags as ___"

"Is __ tagged in block tags as ___"

 

Also, would the on player tick update work with this, or would it cause severe lag?

Any help is greatly appreciated, 

Thank you

Use "iterate slots of entity…
Thu, 01/07/2021 - 17:37

Use "iterate slots of entity" and check if any of the slots contains item tagged as and store this check value in a local variable

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you say "Iterate slots…
Thu, 01/07/2021 - 18:37

When you say "Iterate slots of entities" I don't quite understand, can you show me an example, please?