Creating a item that can store unique data of entities

Started by Aoi_ on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Creating a item that can store unique data of entities

Hello all,

sorry if I am at the wrong place in the forum with my problem or if my questione isn't formed correctly.

I tried to create an item that, when right clicked on an entity and/or player, stores their "unique tag" so that the item later can be used in rituals to, for example, curse this entity or player.

 

My (very wrong) first attempt: https://imgur.com/I6o5LLF

My (also very wrong) second attempt: https://imgur.com/eXjNJvg

I also linked this procedure to the item trigger "When right-clicked (entitiy pos.)"

 

I searched the internet for days for answers and watched the online tutorials that cover NBT but i just don't seem to be able to wrap my head around it.

Hopefully you may be able to help me.

 

Thank you very much in advance <3

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Already, I believe that…
Sun, 09/10/2023 - 08:01

Already, I believe that source entity is the one who does the right click.

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, Source Entity is only…
Sun, 09/10/2023 - 09:29

No,

Source Entity is only needed for Global Triggers like "Before Entity gets Hurt" or" Entity Attacked" Global Triggers.

 

The Global Trigger "Player right clicks on entity" works like that:

Event/Target Entity is the Entity the Player right clicks.

Source Entity is the Player.

 

But if you use the Item Trigger you mentioned "Source Entity" doesn't work and only the Event/Target Entity that specify the Entity you right clicks.

 

Also you don't need any Global Triggers if you link it with an Item Trigger.

If I'm correct you want to save the right clicked Entity, right?

 

First of all I would use to store the NBT Tag directly to the Item and I recommend to store the NBT Tag with the UUID. The UUID is unique for each Entity. Player has it as well.

 

I will test a little bit and I can give you an perfect example for your item.