MagmaGuy / BetterStructures

Adds structures to Minecraft worlds using WorldEdit!
GNU General Public License v3.0
26 stars 12 forks source link

Question: Could I use this to provide more stuffs in the treasure list? #11

Closed Ch3225 closed 1 year ago

Ch3225 commented 1 year ago

I have seen the list of the treasure...My brother said "kinda boring and not so worth to explore". Then I am going to modify the treasure list. I found that there are no enchanted stuffs or potions! And I also referred to the spogit api names, and find nothing. So are there any ways to add enchanted tools&armors&books, or some potions? If not.. Could you add this feature? Thank you. I will see... if there would be other treasure generate plugins to meet this need... That would be great.

Ch3225 commented 1 year ago

Okay. I've reviewed your code, well... it seems that it's gonna spend a lot of time to add this feature. But no problem, I will give it a try by myself.

MagmaGuy commented 1 year ago

I'm not sure what you read but there's a lootify command that will let you convert anything you are holding into something on a drop table. It's just a matter of holding anything you want to see in chests. This includes compatibility for potions, books and even items from other plugins, in theory.

Ch3225 commented 1 year ago

OMG. Sorry for that and thank you for remind me that. I read that but not so carefully. I thought it was same as the treasure.yml. I am sorry. In fact I have searched in your discord for enchant.... I find someone who is talking about that but I thought "lootify? isn't it same as that .yml file?". Ok, it will be better. But there are still problems. it seems that there is a way that we can add several(but not too many) enchanted items into the chest loot. The problem of potions/potioned arrows can be solved now. But enchantment... I think it is still not enough. Imagine that enchanting, they have many kinds of result. The number of available combination could be too big. So I don't think users could add them one by one.(But maybe they can just make serveral kinds of them, or just all the enchant books letting them enchant by themselves, at least the treasure would be looked better, when the players haven't explore too much) But if we can really GENERATE all the possible enchantment randomly use some argument....like original chest loot generated by Minecraft. It would be great though. I know this new feature could be hard. I don't know whether it worth rewriting of the code.

Ch3225 commented 1 year ago

I have come out with a better generating logic though. But still too much to do for me. Some key points:

  1. You can classify something, for example, We can call all kind of the wool "dyed wool", they are a class. In a selection of what to choose, first we select the class. if the "dyed wool" is selected, then we choose what color of the wool to be given. But the color is not so important. So just choose them with equal possibility. Same goes arrows with effects. Also, It could be unequal possibility. Just use a way like overwriting.
  2. The enchantment logic can referring the logic of the enchanting table. Just preset a factor, choose the enchantment (the quality decided by the factor, but the kind are randomized). Then devided it by a random number like in 1.2-2. then repeat(eliminate the enchantment we have chosen, also its opposing enchantment), until the factor is too low or we have no enchantment to choose. I can't tell it clearly because I am kinda sleepy, and now I gotta sleep. If you are interested in this, I will tell you later sometime.