[MC-4264] EntityLiving setHealth(int i) method throws Illegal Argument Exception Created: 08/Dec/12 Updated: 05/May/15 Resolved: 19/Jun/13 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.4.5, Minecraft 1.4.7, Minecraft 1.5.2 |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Josh | Assignee: | Unassigned |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Microsoft Windows [Version 6.1.7600] C:\Users\deathmarine>java -version C:\Users\deathmarine> |
||
| CHK: | |
| Confirmation Status: | Unconfirmed |
| Description |
|
EntityLiving:630 Fix: |
| Comments |
| Comment by [Mojang] Grum (Erik Broes) [ 19/Jun/13 ] |
|
Doesnt exist in 13w25b. |
| Comment by Markku [ 19/Feb/13 ] |
|
1.4.7 Seems to still have the same old code. Would be nice to get instructions on how to reproduce that exception, though. Edit: Not that the wonder of exception matters, the bug is obvious even by reading the code, but just me being curious. |
| Comment by Tails [ 19/Feb/13 ] |
|
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by Kumasasa [ 08/Dec/12 ] |
|
Thanks |
| Comment by [Mod] CubeTheThird [ 08/Dec/12 ] |
|
Corrected your code |
| Comment by Kumasasa [ 08/Dec/12 ] |
|
Well, if everybody throws in his favourite bit of code: public void setHealth(int i) {this.health = Math.min(i,getMaxHealth()} |
| Comment by [Mod] CubeTheThird [ 08/Dec/12 ] |
|
How about: |