You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no way to tell when player unlocks a vault without listening to PlayerInteractEvent, which is far from ideal and based solely on predictions. It is also not possible to modify the ACTIVE and INACTIVE states based on certain condition (eg. plugin implemented per-vault cooldown), without scheduling a "tracker" task that constantly checks if player is in an activation range of a vault.
Describe the solution you'd like.
VaultStateChangeEvent which is called when vault state changes.
Methods:
getEntity or getPlayer - Returns the entity or player associated with the event.
getBlock or getVault - Returns the vault block.
getNewState - Returns the new state.
getPreviousState - Returns the previous state.
setState(Vault.State) or setNewState(Vault.State) - Sets the new state.
isCancelled and setCancelled(Boolean) - If possible, this event should be Cancellable. This would be helpful to alter activation behavior based on some conditions.
Describe alternatives you've considered.
I tried a few things, most of which I described in the section above. Neither of them can be considered an alternative because they are unreliable and require re-inventing and duplicating a lot of code that already exist but is not exposed.
Other
Would be more than happy if anyone suggested a reliable work-around for this event, if one exist. I'm currently developing a plugin where certain vaults can be unlocked multiple times with a specific cooldown. I want the vault to not look active for nearby players when they're on cooldown.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is your feature request related to a problem?
There's currently no way to tell when player unlocks a vault without listening to
PlayerInteractEvent
, which is far from ideal and based solely on predictions. It is also not possible to modify theACTIVE
andINACTIVE
states based on certain condition (eg. plugin implemented per-vault cooldown), without scheduling a "tracker" task that constantly checks if player is in an activation range of a vault.Describe the solution you'd like.
VaultStateChangeEvent
which is called when vault state changes.Methods:
getEntity
orgetPlayer
- Returns the entity or player associated with the event.getBlock
orgetVault
- Returns the vault block.getNewState
- Returns the new state.getPreviousState
- Returns the previous state.setState(Vault.State)
orsetNewState(Vault.State)
- Sets the new state.isCancelled
andsetCancelled(Boolean)
- If possible, this event should beCancellable
. This would be helpful to alter activation behavior based on some conditions.Describe alternatives you've considered.
I tried a few things, most of which I described in the section above. Neither of them can be considered an alternative because they are unreliable and require re-inventing and duplicating a lot of code that already exist but is not exposed.
Other
Would be more than happy if anyone suggested a reliable work-around for this event, if one exist. I'm currently developing a plugin where certain vaults can be unlocked multiple times with a specific cooldown. I want the vault to not look active for nearby players when they're on cooldown.
Beta Was this translation helpful? Give feedback.
All reactions