Jump to content

[1.8](apparently not so)little question about a player and his pets


jokekid

Recommended Posts

alright, the wolf is levelling up and all that stuff, now im finally using the WolfExtendedClass for something, for the sake of testing im making it evolve into an ocelot when it reaches it's max level, so more errors were bound to come.

repo: https://github.com/jokekid/BattleCreatures/tree/GetPetsWithinRange

 

im getting a null pointer exception right here:

https://github.com/jokekid/BattleCreatures/blob/GetPetsWithinRange/src/main/java/com/jokekid/battlecreatures/extEntity/ExtendedTameable.java#L83

 

you guys are probably smacking your heads against the wall cuz i made some stupid mistake, but sorry, im  not seeing it :/

Link to comment
Share on other sites

player was null for a stupid mistake, instead of entity.getOwner(), i needed THIS.entity...

so yeah, but now the ocelot won't spawn...

 

EDIT: everything's working properly now,all i had to do was give the new entity it's coords, which is ez pz :D

i also had to add a check to make sure a tameable entity actually had extended properties before trying to give it experience (ocelots dont have extended properties yet)

 

so yes, i finally got this thing working fully, thanks a bunch diesieben07 you are my hero <3

Link to comment
Share on other sites

EDIT: everything's working properly now,all i had to do was give the new entity it's coords, which is ez pz :D

i also had to add a check to make sure a tameable entity actually had extended properties before trying to give it experience (ocelots dont have extended properties yet)

 

so yes, i finally got this thing working fully, thanks a bunch diesieben07 you are my hero <3

 

for testing purposes i made the wolf evolve into an ocelot.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.