Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by HeroVerseWizard, Jun 5, 2017.
Is it possible to create a shield like a thing which deflects Arrows of players?
I mean, you could check if players inventory contains a certain item when an arrow hits them, and if they have the shield item, or have some shield activated, cancel the damage.
I can do that but I want to have a Visual reperesentation of them delfecting it
like the arrow flies bac
If i remember well, if you cancel damage event the arrow will deflected from the player. So you should check if the player holds shields, cancel the event
You can make an arrow deflect using this
And maybe its a good idea to create some short of circular shield around the player that lightens up for a few seconds once the arrow deflects. This circular shield can be made visible by some sort of particles.
Shield created, but how am i supposed to get an instance of multiple arrows that are being shot towards me
I haven't messed around with the SpigotAPI in about two years but I think there is a event where you can get the arrow instance from. (Try google) Once you have this instance, save it somewhere in some kind of List. Once the arrow is shot, check every x ticks if the arrow is somewhere close to a player with a shield. If so, deflect the error.
That's a possible way to do it.