[Release] EnchantmentBox - Custom Enchantments

#Enchantment Box

##About
EnchantmentBox is a plugin that provides 10+ custom enchantments to the game. It includes a configurable enchanting system, and most enchantments work while being used by mobs.

##Video
The video below showcases a few enchantments:

##Dependencies
EnchantmentBox uses StarAPI. StarAPI is another plugin of mine, where I put everything useful in more than one plugin.

##Enchantment List

  • Launch x - Launches x (x is a projectile)
  • Barrage - Launches additional projectiles whenever a projectile is launched from the enchanted item
  • Encase x - When attacked by an item enchanted with Encase x, the victim will be surrounded by x (x is a block)
  • Fire Thorns - While wearing an item with this enchantment, any attackers will be set on fire
  • Ender Thorns - While wearing an item with this enchantment, any attackers will be teleported around randomly
  • Explosion - Creates an explosion when the item is used to attack something
  • Ninja - When an attacker kills something using a ninja enchanted weapon, it becomes invisible and gains speed
  • Steal - When hit with a steal enchanted weapon, the attacker has the chance to ‘steal’ the item that the victim is holding
  • Teleport - When hit with a teleport enchanted weapon, the victim will be teleported around randomly
  • Thunder - When hit with a thunder enchanted weapon, the victim will be repeatedly struck by lightning
  • Potion - There is an enchantment registered for every single potion type. When hit with a potion enchanted weapon, the victim will receive the potion effect.

##Enchantment System
To access the enchantment system, run the command “/enchantbox enchant.”
A menu of all enchantments should pop up, within that menu, you can enchant or upgrade enchantments on your item.

##Known Bugs

  • Launch enchantment is not functional (This is a Sponge implementation bug, wherein launch projectile does not use the proper Cause - this should be fixed in the most recent Sponge build)
  • Barrage enchantment is not functional (This is a Sponge implementation bug, wherein LaunchProjectileEvent is not implemented)
  • Steal enchantment is not functional (This is a Sponge implementation bug, wherein Equippable’s methods are not implemented yet)

##Commands
/enchantbox enchant - opens the enchanting menu (perm: enchantbox.enchant)
/star enchant clear - clears enchantments on the item you’re holding (perm: star.enchantments.enchant)
/star enchant enchant - enchants the item you;re holding (perm: star.enchantments.enchant)
/star enchant list - lists all enchantments registered

##How It Works
StarAPI holds the custom enchantment API, and EnchantmentBox utilizes it. The enchantment API has two elements, event processors and enchantment handlers. Enchantment handlers, obviously enough, handle enchantments, and function as doctored event listeners. Event processors are responsible for taking raw sponge events, and determining what enchantments are associated with what entities in the event.

##Downloads
EnchantBox
StarAPI

##GitHub
EnchantmentBox
StarAPI:

##For The Judges
StarAPI, as aforementioned, is my own plugin framework. Within it, I throw all sorts of useful code. While creating EnchantmentBox, I realized that and enchantment API would be useful in more places then this plugin, so I transferred it to StarAPI. (In fact, the enchantment commit to Star and the initial commit to EnchantmentBox occurred on the same day). I know the rules specify that dependencies shall not be judged, but I was hoping the judges wouldn’t mind taking a look at the enchantment api in Star. In addition, the menu api in star was developed specifically for the purpose of displaying enchantments to the player.

5 Likes

There seems to be an error with the /help command caused by StarAPI:

[19:53:01 INFO]: Error occurred while executing command: null
[19:53:01 ERROR] [Sponge]: Error occurred while executing command 'help' for source DedicatedServer: null
java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_71]
        at java.util.Optional.<init>(Optional.java:96) ~[?:1.8.0_71]
        at java.util.Optional.of(Optional.java:108) ~[?:1.8.0_71]
        at com.gmail.socraticphoenix.sponge.star.chat.command.MainCommand.getShortDescription(MainCommand.java:104) ~[MainCommand.class:?]
        at org.spongepowered.common.command.SpongeHelpCommand.getDescription(SpongeHelpCommand.java:93) ~[SpongeHelpCommand.class:1.8.9-4.1.0-BETA-269]
        at org.spongepowered.common.command.SpongeHelpCommand.lambda$null$18(SpongeHelpCommand.java:85) ~[SpongeHelpCommand.class:1.8.9-4.1.0-BETA-269]
        at com.google.common.collect.Iterators$8.transform(Iterators.java:794) ~[minecraft_server.1.8.9.jar:?]
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[minecraft_server.1.8.9.jar:?]
        at java.util.AbstractCollection.toArray(AbstractCollection.java:141) ~[?:1.8.0_71]
        at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:258) ~[minecraft_server.1.8.9.jar:?]
        at org.spongepowered.common.command.SpongeHelpCommand.lambda$create$19(SpongeHelpCommand.java:85) ~[SpongeHelpCommand.class:1.8.9-4.1.0-BETA-269]
        at org.spongepowered.api.command.spec.CommandSpec.process(CommandSpec.java:331) ~[CommandSpec.class:1.8.9-4.1.0-BETA-269]
        at org.spongepowered.api.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:331) ~[SimpleDispatcher.class:1.8.9-4.1.0-BETA-269]
        at org.spongepowered.common.command.SpongeCommandManager.process(SpongeCommandManager.java:268) [SpongeCommandManager.class:1.8.9-4.1.0-BETA-269]
        at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:83) [bd.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71333_ah(SourceFile:332) [ko.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(SourceFile:300) [ko.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(SourceFile:535) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:451) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_71]

Ahh the difference between Optional.of and Optional.ofNullable… fixed in version 0.0.58

1 Like

Please add the command /menuexit. This is useful when the chat is cleared. From the menu: It happens that the spell do not apply… it is not clear why.

forge-1.8.9-11.15.1.1890-1.8.9-universal.jar
spongeforge-1.8.9-1890-4.2.0-BETA-1653.jar
EnchantBox-0.0.2.jar
StarAPI-0.0.58.jar

[20:37:07] [Server thread/WARN] [Sponge/sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class com.gmail.socraticphoenix.sponge.star.data.tags.simple.SimpleTagDataBuilder
[20:37:07] [Server thread/WARN] [Sponge/sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class com.gmail.socraticphoenix.sponge.star.data.tags.complex.ComplexTagDataBuilder
[20:37:07] [Server thread/WARN] [Sponge/sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class com.gmail.socraticphoenix.sponge.star.enchantment.data.StarEnchantmentDataManipulatorBuilder
[20:37:07] [Server thread/WARN] [Sponge/sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class com.gmail.socraticphoenix.sponge.star.enchantment.data.StarEnchantmentDataBuilder
[20:37:07] [Server thread/WARN] [Sponge/sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class com.gmail.socraticphoenix.sponge.star.data.tags.simple.SimpleTagDataManipulatorBuilder

@anon34495435
I do not plan on updating this plugin at the current time. I might pick it up in a couple months, buy most of my focus is going towards school, my other plugin, my entry to the new competition, as well as two major, non-sponge projects…

@Socratic_Phoenix In the video… how do you put a stick in the hands of a zombie? I tried many times and nothing came of it. Do not pick up. What is the secret?

@anon34495435
/summon Zombie ~ ~ ~ {CanPickUpLoot:1}

It seemed to me that the stick flies and the zombie picks it :slight_smile:

The stick is launched from a dispenser, and a zombie summoned by the above command picks it up…