Minecraft Username: Gluupor Brief Description: killing >1 mobs from a stack only yields exp for the first and a fraction for every other mob killed Instructions: have a stack of mobs (for the ease of testing i recommend blaze as they yield exactly 10exp per mob) kill >1 see how you only get 10 for the first mob a fraction of exp for every additional mob killed How many times did you recreate this?: couple times, one time i took the following screenshots Result: gained 12 exp after killing 4 blazes Expected Result: gain 40 exp as supposed to (referring to the test i made the screenshots with) or whatever scaling the plugin config had before the update of the plugin (i know that kill-step in the config was messed up as well after updating) Evidence: i made sure the spawner was actually not spawning to avoid having faulty results due to restacking. amount in stack before: amount of exp before: amount in stack after: amount of exp after:
thx @andrewkm i added a comment to the report as to what i think might be the cause of the issue. bear with me tho i took java classes back during my apprenticeship but thats quite some time ago and i just occasionally do some silly more or less useful coding lol
i added a comment to the github issue. maybe @JamieSinn is able to confirm if i am actually correct about my assumption or not.
before: killed 4; expected 40 got 27: killed another 3; expected 30 got 19: still not getting the exp the amount of mobs killed would actually give. tbh im not even sure what the change he made was supposed to do he added a (imo) random add to the calculation. is this supposed to be some sort of scaling? why is it hardcoded if it is ...
https://github.com/Nathat23/StackMob-2/pull/62 this should actually work now. he is doing the -1 on calling multiplication because the entity drops exp by default. then again the additional subtraction was giving faulty results. i also added a "multiply-exp-scaling" option to the config that gets used in the calculation when "multiply-exp-enabled" is true. so in case the need for scaling exp up or down for whatever reason: its possible.
To expand on this - You should NEVER make edits to code on GitHub's website. They have no syntax checking/errors when you mistype something.
i edited it in eclipse locally and tested it locally as well. with the scaling being 1 it gives exactly 10 xp per blaze killed. with scaling like 0.9 it gives 10 for the first blaze (as this is a default drop) and 9 for every additional blaze killed.
i made a change so it actually provides a default in case the config isnt updated right away. again bear with me its been some time but i wanted to help and couldnt get over it lol
only receiving exp for one mob killed (killed 4 blazes received 10 exp as opposed to 40) Spoiler: ... if i am not mistaken this is the wrong way round: ExperienceOrb exp = (ExperienceOrb) dead.getWorld().spawnEntity(dead.getLocation(), EntityType.EXPERIENCE_ORB); exp.setExperience(sm.expTools.multiplyExperience(originalExperience, subtractAmount)); he spawns the orb before setting its experience so i guess the orb spawns with 0 exp and the only 10 exp i get is the exp the entit(blaze) will drop on kill by default. it was actually done the other way round, calculate exp then spawn the orb, before the change. put it in spoiler since theres prolly some other issues after i did some testing one being the fact that hes still doing "multiply-exp-enabled" instead of "multiply-exp.enabled" after changing the config. i changed it to that and got multiplied exp but it was weird values that didnt reflect the amount of mobs i killed. and im actually too tired to test any other possibilities...
yes its broken and i found the cause. create an issue please i will add my findings maybe submit a fix... hes doing an "add" instead of a "multiplication" when doing the calculation for the exp ... copy and paste error
i submitted a PR. when this goes live the config needs to be like: Spoiler: config example multiply-exp: # Multiplies the experience dropped on kill-all/kill-step. enabled: true # Algorithms that should be used for multiplying experience. # LEGACY - algorithm used in StackMob v2.2.9 and older # MINIMAL - only add a small amount of extra experience. # NORMAL - the default amount of extra experience. # GENEROUS - adds a significant amount of extra expierence. # CUSTOM - use a custom multiplier for the extra experience. # CUSTOM_RANDOM - same as CUSTOM but makes multiplier a bit random. algorithm: CUSTOM # Used when the CUSTOM or CUSTOM_RANDOM mode is used above. custom-multiplier: 1.0 algorithm: CUSTOM and multiplier to 1.0 this will resemble what we had before. doing the config change without the fix i submitted will leave use with players getting exp for one additional mob that was actually never killed. (kill 3 get exp for 4 which isnt intended at least from your perspective i guess ^^)