DemonBoiAnzu / ItemQualities

A plugin that adds Qualities to Items, along with the ability for the user to create their own.
MIT License
10 stars 3 forks source link

fortune.... #4

Closed ghost closed 2 years ago

ghost commented 2 years ago

makes fortune stop working

DemonBoiAnzu commented 2 years ago

I'll get on it.

DemonBoiAnzu commented 2 years ago

In my testing, it works fine?

DemonBoiAnzu commented 2 years ago

Yeah, Fortune works perfectly fine on my end. With and without a pickaxe that has a Quality with Double Drops. Both apply perfectly. Double Drops takes the drop amount (fortune is applied before this) and doubles it if it procs.

What's the issue you're having with it? Please be a bit more descriptive.

ghost commented 2 years ago

for me it completely seems to skip fortune and focuses on double drops alone

ghost commented 2 years ago

i was thinking i had fortune on the pickaxe before i downloaded the plugin could that have broken it somehow

ghost commented 2 years ago

it could also be that they dont stack in a good way primarily focusing on the double drop chance and then the 10% on"godly" would apply fortune

ghost commented 2 years ago

i broke 4 diamonds as a test 3 of them doubled fourth one gave 6

ghost commented 2 years ago

i am also questioning if axe with sharpness works either because from the default config sharpness 5 godly d_axe feels like it does not do enough damage

ghost commented 2 years ago

i am loving the plugin tho 👍

ghost commented 2 years ago

oh and server is paper 1.19 #28

DemonBoiAnzu commented 2 years ago

Fortune isn't a 100% thing to activate, even says so on the Minecraft Wiki.

"Fortune I gives a 33% (1⁄3) chance to multiply drops by 2 (averaging 33% (1⁄3) increase), Fortune II gives a chance to multiply drops by 2 or 3 (25% (1⁄4) chance each, averaging 75% (3⁄4) increase), and Fortune III gives a chance to multiply drops by 2, 3, or 4 (20% (1⁄5) chance each, averaging 120% (11⁄5) increase)."

The plugin should not be interrupting that because I'm not doing anything to interrupt it. All I'm doing, when a Quality has Double Drops and it procs, is taking the amount of an item dropped and doubling it. I've done testing with fortune, and it does indeed work just fine. For example; I mine a diamond ore with fortune 3, it drops 4 diamonds, but the pickaxe also has double drops on it's quality and that procs, multiplying it and making it drop 8 diamonds.

If a pickaxe doesn't have Double Drops, or even Double Drops doesn't even activate, my code doesn't trigger either, thus meaning I'm not doing anything to mess with Fortune, and in the example I typed above, it will drop just the 4.

As for Sharpness, same thing goes for it. I have no code anywhere that is modifying attack damage, except for adding Attribute Modifers to the items who have Qualities, and Attribute Modifers should work with enchantments as they're a vanilla thing. And Minecraft applies the damage of enchantments when you deal damage with your weapon, for instance; you attack a zombie, you do 8 damage, but have sharpness 5, the game will add whatever extra damage sharpness 5 will do to that 8 damage before it is applied to the entity you attacked. I'm doing nothing to disrupt this, so it should (and is) functioning how it does in vanilla. But I'll look into it.

As for Fortune again, I don't quite know what I can even do about it. As it seems to function perfectly fine on my end. But I'll try to look more into it.. Is it not dropping how much it's meant to? I don't play Minecraft really anymore, I just make things for it now, so I don't remember the proper drop amounts.

DemonBoiAnzu commented 2 years ago

Okay I just went into a singleplayer world, no mods or anything and tested Fortune 1, 2 and 3.

Fortune 1 - Dropped 1 to 2 Diamonds.

Fortune 2 - Dropped 1 to 3 Diamonds.

Fortune 3 - Dropped 1 to 4 Diamonds.

Which matches my testing with the plugin, as well, except when Double Drops activated it of course doubled whatever the Fortune dropped.

DemonBoiAnzu commented 2 years ago

Okay the Sharpness thing is a bug, it appears Sharpness ISN'T applied when damage is dealt, instead the extra damage is applied directly to the weapons attack damage attribute, but when a custom modifer is applied it.. doesn't?? wtf mojang, Weird, an Attribute Modifer should still account for it. I'll do something to fix it. Thanks for the report!

DemonBoiAnzu commented 2 years ago

I've fixed the Sharpness bug, and since fortune appears to be behaving properly and as intended, and I am unable to recreate the issue you are having with it (maybe another plugin is interfering with it? In my testing I'm using JUST my plugin.), I will be closing this issue.

If you still believe you are having trouble with fortune, feel free to re-open this issue or create a new one.