Current Entity Tamed

Started by maxence_abrt on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Current Entity Tamed

Hello, How can i add a procedure which get the current entity tamed by the player. By example if a player has tamed a Zombie, and I clicked on items, the items get the current entity tamed by the player and despawn it.

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You mean the last tamed…
Tue, 09/05/2023 - 15:50

You mean the last tamed entity? Or all tamed entities?

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In my mod it's not possible…
Tue, 09/05/2023 - 15:54

In my mod it's not possible to tame more than one entity, so the last tamed for example

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, I will suppose the…
Tue, 09/05/2023 - 16:03

Okay, I will suppose the action happens when you right click an entity with right click

 

-Create a procedure with global trigger

-Set global trigger to "Player right clicks on entity"

-If (Item on main hand of source entity) == (Desired item) ->

-if (Is target entity tamed by source entity) ->

-despawn target entity

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Otherwise, you could do the…
Tue, 09/05/2023 - 16:07

Otherwise, you could do the following for needing to right click an item, but not necesserally at the mob->

-Create a procedure with global trigger

-Set global trigger to "Player right clicks with item"

-If (Item on main hand of source entity) == (Desired item) ->

-For each entity as (Entity iterator) at (x,y,z) in a cube square of (Big number) ->

-if (Is target Entity Iterator tamed by source entity) ->

-despawn Entity Iterator