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

Solved Custom npc problem

Discussion in 'Development' started by Nora1903, Jul 20, 2018.

  1. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Look that the image and you know what i want to say
    [​IMG]

    I made custom entity class but when i spawn it, the npc stuck under block :((
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Does it happen when the entity starts moving?
     
  3. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Yes it does, when it start moving , it's legs go throught block above
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Then it's due to not adding the base offset. A player's base offset is 1.62 by default. Add that to the Y axis.
     
  5. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Thanks , solved
     
    jasonwynn10 and Muqsit like this.
  6. Saiini14 TV

    Saiini14 TV Silverfish

    Messages:
    15
    GitHub:
    saini14
    Maybe put the Y axis a little more higher? I tried and it has worked for me.
     
  7. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    That's what Muqsit suggested. Offsetting means to always have the Y value 1.62 blocks higher than whatever y value the entity is actually at, so it raises it by that much when it moves.
     
  8. Saiini14 TV

    Saiini14 TV Silverfish

    Messages:
    15
    GitHub:
    saini14
    I am sorry I really need to read before I type.
     
    XenialDan likes this.
  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.