Started by
maxence_abrt
on
Topic category: Help with modding (Java Edition)
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.
You mean the last tamed entity? Or all tamed entities?
In my mod it's not possible to tame more than one entity, so the last tamed for example
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
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