#Can I make an entity the parent or owner of another entity?

1 messages · Page 1 of 1 (latest)

timid glade
#

I want to use either the follow parent or follow owner behaviors but I'm not sure how to make the entity relationships.

I don't want to use reproduction, so is there any other way to create the parent relationship?

Is there any way to have ownership, or is that player only?

And is there any easier way to have one entity follow another specific entity if not?

thorny plover
#

Yes you can

hidden kettle
hidden kettle
# timid glade I want to use either the follow parent or follow owner behaviors but I'm not sur...

I too have searched for such a solution (wanted to make a wolf pack), but nothing quite what I wanted was achieved. AFAIK, only a player can be an 'owner'... However, here's a few way you might want to try to hack it together:

  • Similar to the suggested guide, the 'parent' launches an invisible projectile. When that projectile hits the target, the target is despawned and the projectile becomes an exact duplicate of that target
  • You can make the 'child' entity be targeting the 'parent', with like 0 att (or ranged attacker using a projectile that does no dmg/knockback. I've done this before. The problem here is the attacker ('child') loses track of the 'parent' often, so it's inconsistent at even relatively short distances apart.
#

There's also 'circle target' (phantom) and 'flock' (fish) behavior that could work in theory, but I never figured out

#

Oh, and there's also the Allay approach. Allays recognize owners through their own mechanic (items held? I forget). However, that mechanic is restricted to them 😦

timid glade
#

Thank you both for the help

#

I was worried that ownership was player specific

#

I don't need it to work on existing entities, so I can spawn them

#

The phantom circling does work. I haven't tested fish flocking yet, I think it's water only though

#

The tutorial seems to rely on the keep owner part of the transformation, and if ownership is restricted to players, is there a way to make it work with parent/child?

#

I might try to have my entity summon a dummy entity or copy to breed with and then kill it.

#

It seems like breedable is restricted to player interaction though

#

Idk if it can be triggered by events or commands

#

You can also have a dummy entity that entities are detecting with an entity or target nearby sensor to switch component groups from moving towards the target or moving randomly/doing other stuff

#

The new caravan component with llamas might work for a wolf pack too if you leash the pack leader to something

timid glade
#

I don't think i could get follow_target_captian to work eithet

opaque adder
#

@hidden kettle couldnt he just put a entity riding above the parent as a target? The 'child' can target the dummy entity at all times.

hidden kettle
opaque adder
#

@timid glade there ya go ^