Solved EchoPet API bug?

Discussion in 'Plugin Help/Development/Requests' started by TheCakeMaster, Mar 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    TheCakeMaster

    Hello, I've been using the EchoPet API lately to create my own Inventory GUI thingy, and I tried using the givePet() method. The pet would spawn fine, but not follow the player. And if the player gets more than 5 blocks away from the pet, it crashes the server. So I tried to use the addGoal() method, but that doesn't seem to work.
    Heres the code I use to activate the pet:
    Code:
    if (getConfig().getBoolean("Players." + player.getUniqueId() +".Pets.MooshroomPet", true)) {
                        getEchoPetAPI().givePet(player, PetType.MUSHROOMCOW, false);
                        getEchoPetAPI().addGoal(getEchoPetAPI().getPet(player), GoalType.FOLLOW_OWNER);
    And here is the crash report from when player gets more than 5 blocks from the pet:
    Code:
    java.lang.NullPointerException: Ticking entity
        at com.dsh105.echopet.api.pet.Pet.getCraftPet(Pet.java:82)
        at com.dsh105.echopet.api.pet.Pet.getLocation(Pet.java:87)
        at com.dsh105.echopet.compat.nms.v1_7_R3.entity.EntityPet.getLocation(EntityPet.java:130)
        at com.dsh105.echopet.compat.nms.v1_7_R3.entity.ai.PetGoalFollowOwner.tick(PetGoalFollowOwner.java:120)
        at com.dsh105.echopet.compat.api.ai.PetGoalSelector.updateGoals(PetGoalSelector.java:175)
        at com.dsh105.echopet.compat.nms.v1_7_R3.entity.EntityPet.bm(EntityPet.java:231)
        at net.minecraft.server.v1_7_R3.EntityLiving.e(EntityLiving.java:1505)
        at net.minecraft.server.v1_7_R3.EntityInsentient.e(EntityInsentient.java:289)
        at com.dsh105.echopet.compat.nms.v1_7_R3.entity.EntityAgeablePet.e(EntityAgeablePet.java:60)
        at net.minecraft.server.v1_7_R3.EntityLiving.h(EntityLiving.java:1368)
        at net.minecraft.server.v1_7_R3.EntityInsentient.h(EntityInsentient.java:150)
        at com.dsh105.echopet.compat.nms.v1_7_R3.entity.EntityPet.h(EntityPet.java:448)
        at net.minecraft.server.v1_7_R3.World.entityJoinedWorld(World.java:1417)
        at net.minecraft.server.v1_7_R3.World.playerJoinedWorld(World.java:1395)
        at net.minecraft.server.v1_7_R3.World.tickEntities(World.java:1280)
        at net.minecraft.server.v1_7_R3.WorldServer.tickEntities(WorldServer.java:481)
        at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:649)
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260)
        at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558)
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469)
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628)
    EchoPet API is here: https://github.com/DSH105/EchoPet/wiki/Developer-API

    Thanks in advance

    - Solved -

    - Solved -

    Fixed, just needed to use the dev build.
    For anyone looking, dev build is here:
    https://ci.dsh105.com/job/EchoPet-v2/

    EDIT by Timtower: merged posts

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
Thread Status:
Not open for further replies.

Share This Page