Obtaining data from an item. (Tag, ID etc.)

Started by VegaOrionis on

Topic category: Help with MCreator software

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Obtaining data from an item. (Tag, ID etc.)

Hello, I'd like to obtain specific item data, specifically the tag. Using the "/data entity" command, I can also see information about items in my inventory and their data. I'd like to obtain this data in MCreator for a specific item, but I don't know how to extract it. I've tried various combinations, but I must be doing something wrong... I'm not getting any feedback when testing. 


https://imgur.com/a/OcH5NfK

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Now it doesn't work the way…
Tue, 09/23/2025 - 18:51

Now it doesn't work the way I wanted it to. XD
It triggers all items in the player's inventory. It doesn't trigger items in blocks (which is what I wanted, but with the ability to select the slot for the slot – a new procedure where I can choose the slot to load).
Also, I noticed that the global "container opened" trigger is gone.
XD

What do you think about my "Custom code snippets" that I wrote, is it possible to fix them somehow and write them correctly to make them work?

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
huh the open trigger isn't…
Tue, 09/23/2025 - 19:03

huh the open trigger isn't gone for me..?

And,

 

um so you want to just be able to get the item in a specific slot?

 

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
one version of the plugin*
Tue, 09/23/2025 - 19:06

one version of the plugin*

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I reinstalled MCreator and…
Tue, 09/23/2025 - 19:56

I reinstalled MCreator and installed a new plugin. It works just like yours. But getting back to the main topic of this forum, I still only want one thing. I'd like to use a procedure, referencing a selected slot (one slot!), to load "tag"  and then download it to, for example, Local Variables.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm that block doesn't…
Tue, 09/23/2025 - 20:13

nvm that block doesn't actually work with variables??

ig just use custom code snippet..

((PlayerEntity)entity).openContainer.getSlot(2).getStack().getTag().toString()

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if you don't wanna change…
Tue, 09/23/2025 - 20:15

if you don't wanna change the custom code snippet to change the slot you can do like,

((PlayerEntity)entity).openContainer.getSlot((int)slot_id).getStack().getTag().toString()

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh that is provided world…
Tue, 09/23/2025 - 20:16

oh that is provided world remote block was supposed to just be a false block x3

it's late..

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for your help and for…
Tue, 09/23/2025 - 20:39

Thanks for your help and for spending so much time on it :)
Now it works the way I wanted. I just wish I knew how to write plugins that would work not only with this version of mCreator but also with 3-4 others. Tomorrow or someday...

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
np :3 the container open…
Tue, 09/23/2025 - 20:42

np :3 the container open trigger might work versions after 2020.5 it's worth a shot to just try when you want to update.

the custom code snippet too

(if you haven't already)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'll check later, thanks ;)
Tue, 09/23/2025 - 20:49

I'll check later, thanks ;)