[SPIGOT-2420] Can't set exp drops to EnderDragon when is death Created: 15/Jun/16 Updated: 18/Jun/22 Resolved: 18/Jun/22 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Matt | Assignee: | Marvin Rieple |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
OS: Ubuntu 12.04 |
||
| Issue Links: |
|
||||||||
| Description |
|
Title say all, no errors in console only my plugin. The dragon the first time drops 68 level, the next times 19 but with this event I should change the level but remains constant! private int random(int min, int max){ return (int) ((Math.random() * max) + min); } @EventHandler(priority=EventPriority.NORMAL, ignoreCancelled=true) public void onEntityDeath(EntityDeathEvent ev){ Entity e = ev.getEntity(); if(e instanceof EnderDragon){ ev.setDroppedExp(0); }else return; } |
| Comments |
| Comment by Marvin Rieple [ 12/Jun/22 ] |
|
Made a PR for this: craftbukkit#1069 |
| Comment by nosxxx [ 15/Oct/16 ] |
|
Is there any update ? |
| Comment by minoneer [ 17/Jul/16 ] |
|
Those magic values are the total amount of XP dropped during the diing phase. 12000 for the first dragon killed, 500 for any following. Experience drops: if tick > 150 and tick % 5 == 0 -> drop 0.08*exp experience => (10 * 0.08*exp) + (1 * 0.02*exp) = exp The dragon drops 8% of it's XP each 5 ticks during the last 50 ticks of it's diing process, plus an additional 20% at the very end. |
| Comment by md_5 [ 16/Jun/16 ] |
|
I mean I guess we could add an experience override API for ender dragons, but someone would need to figure out the meaning of the magic values 500 and 12000 for first kill... |
| Comment by md_5 [ 16/Jun/16 ] |
|
Right. Ender dragons are special in the sense that the experience they drop is calculated based on their lifetime etc, and not just random like normal mobs. |