Enchantment Plugin

Im thinking of making a custom enchant plugin with configurable enchants.

I want the name, lore, effects to be easily configurable from config for example:

“id” {
enchantment-name : < name>
enchantment-lore : < lore>
enchantment-effects : {
< effect>,
< effect>
}
}

I want to know any snippets of code you all may have that could help me just things i can look at before i go all in so i have an idea what im going in for, iv never used sponge to code before so this is my first time i know it is similar but also very different…

I mainly need the code to get a players item, read the name and lore and apply enchantment or block effects depending on which lore is present, also what to import excetera, i know i can view the online github but i can get alot more information from great minds on here :slight_smile:

To get lore, display name, etc of an item or a lot of things in minecraft. Use the Keys part of the sponge.

For example.

ItemStack stack;
Text name = stack.get(Keys.DISPLAY_NAME).get();

To apply them. Simply use the Offer key. Such as the following

ItemStack stack;
Text newName;
stack.offer(Keys.DISPLAY_NAME, newName);

While it maybe a great idea to ask the public for help, due to what your asking being so broad, the SpongeDocs maybe a better starting point as the sponge team have put a lot of work covering many points of Sponge in huge detail in a way that I could not explain better. Plus you don’t need to wait for us to reply :wink:

https://docs.spongepowered.org/stable/en-GB/plugin/index.html

1 Like