Let's talk Event Priorities in some plugins

Discussion in 'Spigot Plugin Help' started by Dominoose, Feb 5, 2020.

  1. Hello Spigot,

    For the past few weeks, I have been trying to configure the plugins listed below so that TEExplosiveEvent + fortune work, while popping up autosell messages containing the information about the players' sell stats.

    TE Enchants

    I've seeked help to the point of reaching to a developer friend of mine, but to no avail. In general, after taking a few looks at the Event Priority API page, I have a rough idea how it works, but the main setback has been confusion regarding how the priorities work in conjunction with other plugins. This has created side problems such as VKAutopickup overriding worldguard's attempts to cancel events, leading players to be able to break blocks in regions.

    If anyone could please explain how priorities work with other plugins and how the events of one plugin can potentially override the events in another, or provide a method of setting these priorities to accomplish what I was seeking for, I would be beyond appreciative because this has been a frustrating setback that has halted the development of my server.

    Thank you so much for your assistance and time!
  2. vk2gpz Tagging you so you can see this.
  3. Because I was referencing multiple plugins I wasn't sure who to seek support for, thank you!
  4. electronicboy

    IRC Staff

    event priorities are pretty trivial:
    events handlers are called from lowest > highest in the order they're registered, the general expectation is basically, that plugins are sane towards one another in chosing what priority to listen on, there is no hard solid guide, but basically:
    if you wanna cancel an event, you generally wanna be on the lower priorities, that way other plugins can observe the cancellation easier
    if you wanna check if other plugins have cancelled the event, but wanna do your own stuff, normal is generally fine
    highest is a bit of a misnomer, but is generally for cases where you wanna react to something, but often not modify the actual outcome of the event, or essentially takeover the event
    monitor covers checking the event after all other plugins have processed it, modifying the event here is evil
    • Informative Informative x 1
    • Winner Winner x 1
  5. as md_5 indicated many times in the past, the support for my premium plugin won't be provided in the public forum. Since you've purchased my premium resource, you can use vk2gp.freshdesk.com or join our discord to receive the support to sort out the issue you're having. All my plugins use a library which allows you to change event priority at the runtime.