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

Luck stat and tooltip #6

Closed kvakkvak closed 2 years ago

kvakkvak commented 2 years ago

Hello, When I use luck "GENERIC_LUCK": { "uuid": "bea1d20b-33cf-484d-8ee8-f967081a3b30", "name": "GENERIC_LUCK", "amount": 3, "operation": "ADD_NUMBER" } It works but it does this https://gyazo.com/0cf4448bc4e66c6443cc712e542b44dc I dont know if links work on here so i am also putting it in as a picture 0cf4448bc4e66c6443cc712e542b44dc

But I dont want it to be so long, I cant see the other stuff on it, when I use luck like this and afterwards i add "slot": "HAND", Helm, or any other. It doesnt work, it breaks and I need to remove the "slot" out of it.

So how do i do it so that the luck doesnt "break" the tooltip?

DemonBoiAnzu commented 2 years ago

Why do you need to remove the slot option? This is vanilla Minecraft behavior, if an Attribute Modifer doesn't define a slot, it just adds the Attribute Modifer to all slots. I can possibly do some hacky thing to prevent this, however. I'll try to do so! Thanks for the report.

DemonBoiAnzu commented 2 years ago

I have fixed this issue, it now will default to a specific slot depending on the type of item if no slot is provided when creating the modifier.

For instance:

If the item is a sword, it will default to the main hand slot.

If the item is an armor piece, for this example a helmet, it will default to the head slot.

This fix will come with the next update, if you still run into any problem similar after that, please re-open this issue or create a new one!

Have a great day,

kvakkvak commented 2 years ago

The same thing happens with speed stat, also shows up many times, It s just a visual thing but it makes it unable to read rest of the stats on the weapon :(

DemonBoiAnzu commented 2 years ago

That doesn't make any sense, I put the speed stat on a test quality and it displayed fine?? wtf

DemonBoiAnzu commented 2 years ago

Did you update to version 1.0.6? I just released it

kvakkvak commented 2 years ago

I indeed missed the new version and that was the issue. I apologise. Thank you for your time :)

DemonBoiAnzu commented 2 years ago

You're all good! You're welcome, and thanks for your report! I'm glad you're liking the plugin!

kvakkvak commented 2 years ago

Yeah, it s pretty awesome we are group of friends of like 5-7 people and we are trying to enchance our vanilla experience :D This plugin makes it very flavourful alongside with mcmmo :D I might have found out a new bug or a bug in my editing, I cant tell. But with this addition: { "key": { "namespace": "itemqualities", "key": "Demonic" }, "display": "§6Demonic", "modifiers": { "GENERIC_ARMOR": { "uuid": "f488faad-97b0-4bce-8c52-096054a02ba0", "name": "GENERIC_ARMOR", "amount": 4, "operation": "ADD_NUMBER" }, "GENERIC_ARMOR_TOUGHNESS": { "uuid": "84957af1-7f79-4cc7-ac64-b0ebabad822f", "name": "GENERIC_ARMOR_TOUGHNESS", "amount": 2, "operation": "ADD_NUMBER" }, "GENERIC_KNOCKBACK_RESISTANCE": { "uuid": "83f79f59-7a38-4201-a7a5-ed22fa0c6ed3", "name": "GENERIC_KNOCKBACK_RESISTANCE", "amount": 0.1, "operation": "ADD_NUMBER", "slot": "OFF_HAND" }, "GENERIC_MAX_HEALTH": { "uuid": "d26b20fa-8ced-4c3c-b632-1e225f617d82", "name": "GENERIC_MAX_HEALTH", "amount": 1, "operation": "ADD_NUMBER", "slot": "CHEST" }, "GENERIC_ATTACK_DAMAGE": { "uuid": "c29a5fb9-23ba-4dac-b23f-7e0aa5ead6c3", "name": "GENERIC_ATTACK_DAMAGE", "amount": 6, "operation": "ADD_NUMBER", "slot": "HAND" }, "GENERIC_MOVEMENT_SPEED": { "uuid": "3ea4e887-9194-4141-bf63-f6eefa403f19", "name": "GENERIC_MOVEMENT_SPEED", "amount": 0.01, "operation": "ADD_NUMBER", "slot": "FEET" }, "GENERIC_LUCK": { "uuid": "16ca60c3-caaf-438a-8a25-3df26e3e38d9", "name": "GENERIC_LUCK", "amount": 0.5, "operation": "ADD_NUMBER", "slot": "HEAD" }, "GENERIC_ATTACK_SPEED": { "uuid": "bea1d20b-33cf-484d-8ee8-f967081a3b30", "name": "GENERIC_ATTACK_SPEED", "amount": 3, "operation": "ADD_NUMBER" } }, "addToItemChance": 1, "itemMaxDurabilityMod": 120, "noDurabilityLossChance": 80, "extraDurabilityLoss": 0, "extraDurabilityLossChance": 0, "noDropChance": 0, "doubleDropsChance": 33, "tier": 30 } It applies all of the "Off_hand", "Head" buffs on every other also as you can see here https://gyazo.com/9d91ecccc7629699250ce3f0042d2385 Speed and luck shouldnt be here. I didnt use slot: hand on the attack speed and that one works well doesnt add speed on armor, but that might be because of the game. I dont know enough about that :(

Ive also put tier to 30 in hopes to make this enchant more rare, addtoitemchance doesnt work if i put 0.1 chances (Might have been fixed in newever versions i havent tried on the newest one yet) Is there any other way of making it more rare?

And lastly if there is somewhere i can see what colours i can use and what letters they are. I am bit of a total noob with code, so i am just trying my best to get this all working :D Thank you one more time for your time. Truly appreciate it. This is my first time getting deeper into a plugin and their settings

kvakkvak commented 2 years ago

Oh and also if i put "GENERIC_LUCK": { "uuid": "16ca60c3-caaf-438a-8a25-3df26e3e38d9", "name": "GENERIC_LUCK", "amount": 1.5, "operation": "ADD_NUMBER", "slot": "HEAD" }, "GENERIC_LUCK": { "uuid": "e7a48d89-a334-424a-af28-1d98f2727e44", "name": "GENERIC_LUCK", "amount": 0.5, "operation": "ADD_NUMBER", "slot": "OFF_HAND" } For when I would like one quality to give slightly different stats to different items, i just used luck as an example, but i would probably end up using the health, I would want to put it on shield and on chest, but if i do both it breaks

DemonBoiAnzu commented 2 years ago

You can't do decimals for chances, it has to be a chance of 0 to 100.

As for it added Luck to the armor, sadly that is a part of the game, Maybe I can make my own Attribute Modifier system so you can specify Slots to ignore, but that will come at a later time as it will probably ruin a lot of peoples qualities.

Also, here's a chart for color codes I used to use often: image

And yeah, sadly due to how Minecrafts Attribute Modifiers work, you can't do 2 of the same ones. With my custom attribute modifier that I'll be adding, I'll have a system for doing so. I apologize for the inconvenience.

kvakkvak commented 2 years ago

No worries if minecraft doesnt allow it :D There seems to be some strange interaction, as it for when demonic goes onto a shovel it shows it as I would like it for it to work, but on a armor it goes wild https://gyazo.com/3240748ce44281c85fab55697afcaf19

DemonBoiAnzu commented 2 years ago

grrr, Another bug! It's meant to only display the Attribute modifers if its the correct item type to avoid "when on head" and such on a weapon/tool.

Minecrafts Attribute system is HORRIBLE man lol

I'll try to fix this, I'm sorry.

kvakkvak commented 2 years ago

It s no problem :) Thank you for the great plugin! Ill be playing with it more and if i see something that seems little wonky, Ill update this thread :D

DemonBoiAnzu commented 2 years ago

Of course man, and thank you very much for your reports!

DemonBoiAnzu commented 2 years ago

Small update, I think you will like it, now you only need to define the amount and optionally a slot when adding an attribute modifier. The operation, UUID and name were unnecessary. (coming in next update)

DemonBoiAnzu commented 2 years ago

Another update; I've added a system where you can specify slots you want to ignore when the modifer is applied (like, if the items main slot is HAND, and thats in the ignored list for a modifer for the quality, it wont add to the item)

and you can also specify amounts for each slot.

example json: image

kvakkvak commented 2 years ago

This is gonna be amazing update, gonna put this plugin on much higher level, it looks easier to make new stuff too. Cant wait to get my hands on it :D