Solved How do I do temporary attribute modifiers?

Discussion in 'Plugin Development' started by Minecraft Zealot, Dec 22, 2023.

Thread Status:
Not open for further replies.
  1. I would like to create temporary Minecraft attribute modifiers for a custom enchantment plugin that I am making. I would like to apply things such as extra speed/absorption to players and items.
    I can add/remove attributes with no problem; I just have a BukkitTask that removes the attribute after a certain amount of time.
    My problem arises when the player were to disconnect before the BukkitTask removes their attribute. I suppose a hashmap could store players and items that need to have their attribute removed, but that may not work when the server restarts before the player logs back on to have their attribute removed.
    I guess persistent data could be a solution for this…?
    What is the most simple way to add temporary attributes to players and items that would still work if the player were to leave the server before the duration of their temporary attribute ended?
  2. Online

    timtower Administrator Administrator Moderator

    Minecraft Zealot likes this.
Thread Status:
Not open for further replies.

Share This Page