Current Entity Tamed

Started by maxence_abrt on

Topic category: Help with modding (Java Edition)

Last seen on 17:21, 4. Nov 2023
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.

Last seen on 01:37, 20. Apr 2024
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?

Last seen on 17:21, 4. Nov 2023
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

Last seen on 01:37, 20. Apr 2024
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

Last seen on 01:37, 20. Apr 2024
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