GithubHelp home page GithubHelp logo

eniripsa96 / enchantmentapi Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 24.0 162 KB

A Minecraft plugin built on the Spigot platform allowing for customization of enchantments

License: MIT License

Java 100.00%

enchantmentapi's People

Contributors

eniripsa96 avatar hsgamer avatar magnetitemc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enchantmentapi's Issues

An option to hide enchantment hints

As of Minecraft 1.8, hints are displayed upon hovering on the enchant slot:
hints

Using ProtocolLib, it is possible to hide the tooltip: http://pastebin.com/L7XuVwVS
Notice: I used PacketWrapper library, but it is possible to make it without it.

It would be appreciated if we could choose if we want to hide the tooltips, as they display incorrect enchant because of the custom enchants that the client does not know about.

Some errors in latest version

error:
[19:17:03 ERROR]: Could not pass event EntityDamageByEntityEvent to EnchantmentAPI v4.29
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:90) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:575) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:480) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:607) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityLiving.damageEntity0(EntityLiving.java:1308) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityHuman.damageEntity0(EntityHuman.java:864) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityLiving.damageEntity(EntityLiving.java:854) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityHuman.damageEntity(EntityHuman.java:782) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityPlayer.damageEntity(EntityPlayer.java:501) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityHuman.attack(EntityHuman.java:1023) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.EntityPlayer.attack(EntityPlayer.java:1141) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1568) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.PacketPlayInUseEntity.a(SourceFile:69) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.PacketPlayInUseEntity.a(SourceFile:13) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66]
at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:739) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574) [overcraft.jar:git-Spigot-7d78b81-70bc70b]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
Caused by: java.lang.NoSuchMethodError: org.bukkit.event.entity.EntityDamageByEntityEvent.(Lorg/bukkit/entity/Entity;Lorg/bukkit/entity/Entity;Lorg/bukkit/event/entity/EntityDamageEvent$DamageCause;I)V
at com.sucy.potion.ConfigurableEnchantment.works(ConfigurableEnchantment.java:283) ~[?:?]
at com.sucy.potion.damaged.absorb.PotionAbsorb.applyDefenseEffect(PotionAbsorb.java:39) ~[?:?]
at com.rit.sucy.enchanting.EListener.onHit(EListener.java:110) ~[?:?]
at sun.reflect.GeneratedMethodAccessor424.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[overcraft.jar:git-Spigot-7d78b81-70bc70b]
... 26 more

No enchant works

Different items in anvil causes problems

If you try to put two different items into an anvil (such as a gold iron pickaxe and a stone sword), it will combine the items as if they were the same. This issue occurs on paperspigot and regular spigot on the latest versions of EnchantmentAPI and spigot.
Image is here

Adding Enchantment in Code

I was wondering if there was a way to let the coder to add the custom enchant to an item in the code instead of needing the player to enchant it. What I mean is that the coder can listen to PlayerInteractEvent or something then when he wants to he can do player.getItemInHand().addEnchantment(CustomEnchantment.SOMETHING, 1);

Thanks,
Tim

Drinking milk removes effect

As title says, when I add a potion effect on "applyEquipEffect", it is removed upon drinking milk. I know this is intended behaviour of milk, but if you have time can you please add some checks and prevent it? Thanks.

1.7 Style Enchanting Option (Enhancement)

I personally like enchantments taking full levels and hate the new lapis lazuli requirement so I propose that you add an option too allow plugin users to select which enchanting version they prefer; the new 1.8 or the old 1.7 style.

Anvil Broken

Field container = ContainerAnvilInventory.class.getDeclaredField("a");
(From MainAnvil.java)
this throws an exception every time the anvil is used, since i believe "a" is a private field
i also saw your comment there, figured you had some issues anyway

Modify applyOnEquip

I've been playing around with EnchantmentAPI for a bit, and I've found that if I hold an armor piece with an enchantment, the applyOnEquip effect happens. Maybe, there could be an option of saying for an effect to happen only if it's on the armor, and not in hand.

[Suggestion] Placeholders on book name

Hey, one of my user asked (he means the finished book with enchants, not while it's in enchant table):

I was wondering if it books could look a little like this:

  • %Enchantment%
  • %Success Rate% (chance of working when you drop it on a tool/weapon and it enchants)
  • %Destroy Rate% (chance of working when you drop it on a tool/weapon and it enchants)
  • %info% (what the enchantment does)
  • %Armor Enchantment/ Tool Enchantment% (Can it be applied on armor or tools?)

So I wonder if it could be possible. Thanks for answer.

Suggest

Add option to disable plugin per world to stop spawn and plots problems!

(temporaly way to solve, block pvp in worldguard regions)

Factions compatibility bug

I'm was trying to apply an effect to ally faction members when the applyDefenseEffect was activated and I found that it was blocked by "You cannot hurt your own faction member."

I tried to apply this to the ally player

LivingEntity le = (LivingEntity) entity;
double health = le.getHealth() + health(level);
if (health > le.getMaxHealth()) health = le.getMaxHealth();
le.setHealth(health);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.