CommandHelper

CommandHelper

46.5k Downloads

exp_change event is not fired on getting advancement

LadyCailinBot opened this issue · 2 comments

commented

CMDHELPER-3164 - Reported by Алексей.Положенцев

bind(exp_change, null, null, @event){
console(@event)
modify_event('amount', 0)
cancel()
}

In that case, if player gets any 'advancement', he still receives exp and message is not shown in console.

commented

Comment by PseudoKnight

The new advancements are weakly handled in Bukkit right now, so this doesn't surprise me. This is likely out of our control, even if I was to attempt to write a special workaround. I'll take a look at the code and if appropriate I'll create a ticket on the Spigot tracker.

commented

Comment by PseudoKnight

So Bukkit docs say "Called when a players experience changes naturally" so it's possible it was never intended to be used for other methods of gaining exp. I think the bigger issue here is that AdvancementDoneEvent is not cancellable, so we can't stop the advancement or the experience the player gets. For my server I've had to write a plugin to reverse any advancements you get in a separate world from our survival worlds. I have to disable advancement announcements for that world and it still doesn't solve the exp thing. I suppose I could remove the exp afterwards.

I think the only thing you can do right now is do what I did with a custom plugin or modify the advancement to not give exp, though I haven't tried that before.