#HELP ME

1 messages · Page 1 of 1 (latest)

jade harbor
#

HELP ME

#

Why is my dummy taking dmg when I hit it?

@EventHandler
public void onPvP(EntityDamageByEntityEvent event) {
    event.setCancelled(true);
#

its registered

#

It's my test server + I later in the method I cancel dmg in a cuboid and that works

cerulean mica
jade harbor
#

There is no need, I cancel it at the very top of the event as shown here

#

it should cancel it all

cerulean mica
#

what are you actually trying to do here, are you just wanting to cancel any damage done to players?

jade harbor
#

Well in this case I just call the event and cancel it straight away and that doesn't work, no if or anything

#

and it doesnt work

#

when it should

#

later I have an if and it works there

#
        if (this.plugin.getSpawnController().getCuboid().isIn((victim)) && this.plugin.getSpawnController().getCuboid().isIn((attacker)) ||
            !this.plugin.getSpawnController().getCuboid().isIn((victim)) && this.plugin.getSpawnController().getCuboid().isIn((attacker)) ||
            this.plugin.getSpawnController().getCuboid().isIn((victim)) && !this.plugin.getSpawnController().getCuboid().isIn((attacker))) {

            event.setCancelled(true);
        }
cerulean mica
#

is it meant to only apply to players or npcs too

jade harbor
#

well my dummy is an npc

jade harbor
#

no errors btw

cerulean mica
#

havent done anything with npcs/nms yet so the best i can advise is to check javadocs and see what they say

jade harbor
#

ill send a vid 1s

jade harbor
#

hi?

muted horizon
#

Send the entire code

muted horizon
#

Does the event fire

jade harbor
#

Yes

#

I've debugged that

muted horizon
#

Any other plugins installed?

jade harbor
#

ye

muted horizon
#

Remove them

jade harbor
#

ok

jade harbor
distant lantern
#

Hi

jade harbor
#

hi

distant lantern
#

I couldnt find it

jade harbor
muted horizon
#

Delete them

jade harbor
#

aight going in with nothing but this 1m

jade harbor
#

worke3d

#

amazing

#

cant wait to test them 1 by 1

#

found it

#

it was vault

#

??????

#

wtf

muted horizon
#

🤔

distant lantern
#

Yes

#

Other plugins can cause problems

#

So the solution is giving your Event Handler the highest priority