1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Leash entities

Discussion in 'Development' started by SkyZone, Aug 10, 2018.

  1. SkyZone

    SkyZone Slime

    Messages:
    95
    I have created an custom entity class which extends Entity. Now i want to leash that entity with an player. How can i do this?
    I found this: http://prntscr.com/kh6pdo in Entity but i didnt help me.

    Also I found nothing on this forums about leashing.
     
    RyanShaw likes this.
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    You'll have to set the flag you posted an image of and set the holder entity to the player the leash should be connected to.
     
    Last edited: Aug 11, 2018
    HimbeersaftLP likes this.
  3. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    It's a little old, but this thread should still have some value. You'll also probably need this.
     
    Sandertv likes this.
  4. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Off-topic but why is @SOFe banned there?
     
  5. SkyZone

    SkyZone Slime

    Messages:
    95
    PHP:
    $this->setGenericFlag(self::DATA_FLAG_LEASHEDtrue);
            
    $this->setGenericFlag(self::DATA_OWNER_EID$player->getId());
    This doesnt work :/
     
  6. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    The owner ID is not a flag but entity data. Cory pointed out too that you need the leash holder EID.
     
    corytortoise likes this.
  7. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Slapper had that bug when 0.16 came out. I used a fork then so I would load old plugins (I was not a developer) and I have a leash bug with the human slappers.
     
  8. SkyZone

    SkyZone Slime

    Messages:
    95
    PHP:
    $this->propertyManager->setLong(self::DATA_LEAD_HOLDER_EID$player->getId());
    This worked for me
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.