Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] plugin_reload event #78

Open
Clexus opened this issue Jul 17, 2024 · 5 comments
Open

[Feature Request] plugin_reload event #78

Clexus opened this issue Jul 17, 2024 · 5 comments

Comments

@Clexus
Copy link

Clexus commented Jul 17, 2024

I have some events that set variable to true and "wait" and set to false.
But when the plugin reloaded, wait actions will stop, and the variables keep the true value.
I need a plugin_reload event, it's a player event

@Ajneb97
Copy link
Owner

Ajneb97 commented Jul 17, 2024

Could you provide me with an event example? Wait actions tasks are not managed at all, so they never should stop.

@Clexus
Copy link
Author

Clexus commented Jul 18, 2024

reload event example or wait event example?

syqx:
    type: call
    conditions:
    - '%mycommand_playerdata_tiaozhaning% != yes'
    actions:
      default:
      - 'player_command_as_op: setplayerdata %player% tiaozhaning yes'
      - 'player_command_as_op: setplayerdata %player% tiaozhan.syqx.wh 0'
      - 'player_command_as_op: setplayerdata %player% tiaozhan.syqx.slss 0'
      - 'wait: 300'
      - 'call_event: syqx2'
  syqx2:
    type: call
    conditions:
    - '%mycommand_playerdata_tiaozhaning% == yes'
    - '%mycommand_playerdata_tiaozhan.syqx.wh% < 100 or %mycommand_playerdata_tiaozhan.syqx.wh% < 100 execute fail'
    - '%mycommand_playerdata_tiaozhan.syqx.wh% >= 100 and %mycommand_playerdata_tiaozhan.syqx.wh% >= 100 execute suc'
    actions:
      fail:
      - 'message: &c&l挑战失败...你只杀了&4&l%mycommand_playerdata_tiaozhan.syqx.wh%&c&l个亡魂和&4&l%mycommand_playerdata_tiaozhan.syqx.slss%&c&l个死灵术师'
      - 'player_command_as_op: setplayerdata %player% tiaozhaning no'
      - 'player_command_as_op: addplayerdata %player% tiaozhan.fail.all 1'
      - 'player_command_as_op: addplayerdata %player% tiaozhan.fail.syqx 1'
      suc:
      - 'message: &e&l挑战成功!你杀了&4&l%mycommand_playerdata_tiaozhan.syqx.wh%&e&l个亡魂和&4&l%mycommand_playerdata_tiaozhan.syqx.slss%&e&l个死灵术师!'
      - 'player_command_as_op: setplayerdata %player% tiaozhaning no'
      - 'player_command_as_op: addplayerdata %player% tiaozhan.suc.all 1'
      - 'player_command_as_op: addplayerdata %player% tiaozhan.suc.syqx 1'
      - 'console_command: eco give %player% 12000'
      - 'console_command: p give %player% 200'

In the events above, players are doing challenges, they need to kill 100 A mob and B mob in 5 minutes. So there's "wait:300"
When I reload plugin, wait action in "syqx" will stop, and tiaozhaning variable keep the "yes" value
Players should rejoin to set them to false automatically

@Ajneb97
Copy link
Owner

Ajneb97 commented Jul 18, 2024

But what does "setplayerdata" have anything to do with ConditionalEvents? If you want the variable to be reset when you use /ce reload, then you must use a player_command or console_command event and reset the variables manually.

@Clexus
Copy link
Author

Clexus commented Jul 18, 2024

But what does "setplayerdata" have anything to do with ConditionalEvents? If you want the variable to be reset when you use /ce reload, then you must use a player_command or console_command event and reset the variables manually.

The problem is wait action, not my commands, if wait actions won't stop after reloading, the datas will finally set to false

@Ajneb97
Copy link
Owner

Ajneb97 commented Jul 18, 2024

That's why I meant by my initial response:
"Wait actions tasks are not managed at all, so they never should stop."

For that I need to create an interrupt manager to stop wait actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants