Java Eclipse .getMaxHealth() error?

Status
This thread has been locked.

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
Hey,

I'm wondering have anyone found fix for this retarded error http://prntscr.com/dp8jia I've been searching google and nothing was helpful..
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
Player health is a double so you have to set it to a double. You are setting it as an integer.
 

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
Player health is a double so you have to set it to a double. You are setting it as an integer.
Can you give me an example cuz i'm dumb hah Kappa
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/notifyz-scam-report.515571/)

WristzPvP

Feedback score
1
Posts
138
Reactions
49
Resources
0
found fix for this retarded error
found fix for this retarded error
found fix for this retarded error

There is a fix, it's called learning Java or even basic math.
This isn't even an error, it is you not knowing what a double is.

Triggered

Code:
Damageable damageable = player;
damageable.getMaxHealth();
[DOUBLEPOST=1483031056][/DOUBLEPOST]
This is not even true lol.

What about it isn't?
 
Last edited:

Notifyz

x
Banned
Feedback score
128
Posts
2,523
Reactions
2,639
Resources
0
Player health is a double so you have to set it to a double. You are setting it as an integer.

Does Math.min return a double or an integer? It needs to be a double so cast it. (double) Math.min..

Try this: ((CraftPlayer)p).getMaxHealth()

There is a fix, it's called learning Java or even basic math.
This isn't even an error, it is you not knowing what a double is.

Triggered



What about it isn't?

Code:
Damageable damageable = player;
damageable.getMaxHealth();
[DOUBLEPOST=1483031056][/DOUBLEPOST]
This is not even true lol.

I want to shoot myself after reading that.

It was weird to me because this was in source , so that's why I'm asking...?
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/notifyz-scam-report.515571/)

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
It was weird to me because this was in source , so that's why I'm asking...?
Are you modifying code you know nothing about? It must be outdated, health values have been doubles for quite a few versions now..
 

WristzPvP

Feedback score
1
Posts
138
Reactions
49
Resources
0
It was weird to me because this was in source , so that's why I'm asking...?
Let me guess you're using a decompiler and copying the code?
 

Hunting_Potato

Developer
Deactivated
Feedback score
11
Posts
745
Reactions
425
Resources
0
Cast the player to a Damagable and this will be fixed.
 

Hunting_Potato

Developer
Deactivated
Feedback score
11
Posts
745
Reactions
425
Resources
0

Hunting_Potato

Developer
Deactivated
Feedback score
11
Posts
745
Reactions
425
Resources
0
Status
This thread has been locked.
Top