Rewards icon indicating copy to clipboard operation
Rewards copied to clipboard

Crash

Open NdaruAjaa opened this issue 2 years ago • 7 comments

THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: Rewards

Thread: Main Error: Wertzui123\Rewards\events\RewardClaimEvent::__construct(): Argument #2 ($commands) must be of type array, null given, called in phar:///home/container/plugins/Rewards.phar/src/Wertzui123/Rewards/commands/RewardCommand.php on line 49 File: plugins/Rewards.phar/src/Wertzui123/Rewards/events/RewardClaimEvent Line: 25 Type: TypeError Backtrace: #0 plugins/Rewards.phar/src/Wertzui123/Rewards/commands/RewardCommand(49): Wertzui123\Rewards\events\RewardClaimEvent->__construct(object pocketmine\player\Player#242312, null, int 1) #1 pmsrc/src/command/SimpleCommandMap(212): Wertzui123\Rewards\commands\RewardCommand->execute(object pocketmine\player\Player#242312, string[5] daily, array[0]) #2 pmsrc/src/Server(1442): pocketmine\command\SimpleCommandMap->dispatch(object pocketmine\player\Player#242312, string[5] daily) #3 plugins/Slapper/src/slapper/Main(228): pocketmine\Server->dispatchCommand(object pocketmine\player\Player#242312, string[5] daily) #4 pmsrc/src/command/PluginCommand(46): slapper\Main->onCommand(object slapper\SlapperCommandSender#44106, object pocketmine\command\PluginCommand#61002, string[3] rca, array[1]) #5 pmsrc/src/command/SimpleCommandMap(212): pocketmine\command\PluginCommand->execute(object slapper\SlapperCommandSender#44106, string[3] rca, array[2]) #6 pmsrc/src/Server(1442): pocketmine\command\SimpleCommandMap->dispatch(object slapper\SlapperCommandSender#44106, string[20] rca "jvupiter" daily) #7 plugins/Slapper/src/slapper/Main(694): pocketmine\Server->dispatchCommand(object slapper\SlapperCommandSender#44106, string[20] rca "jvupiter" daily) #8 pmsrc/src/event/RegisteredListener(61): slapper\Main->onEntityDamage(object pocketmine\event\entity\EntityDamageByEntityEvent#90270) #9 pmsrc/src/event/Event(63): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\entity\EntityDamageByEntityEvent#90270)

NdaruAjaa avatar Oct 29 '23 12:10 NdaruAjaa

Could you please send me the contents of your config after # The /reward command?

Wertzui123 avatar Nov 01 '23 16:11 Wertzui123


Don't edit this if you don't know what you're doing

config-version: 5.0

In which data provider the user data should be stored. If you don't know what that means, don't edit this

data_storage: "JSON" # Providers: JSON, YAML

Multiple permission groups can be set up to allow certain players to get other rewards than normal players

If a player has the permission for multiple permission groups, the first group in the list will be their permission group

'default' is the default permission group

permission_groups:

  • vip
  • vip+ # players need the permission rewards.permissions.vip to get the rewards from this group

Reward streaks are strikes when you claim your reward multiple times in a row

Strikes start at 1 when you claim your reward 2 times in the timespan of waiting_time * 3

E.g. when you have to wait 1 day, you can wait up to 48 hours after you claimed your reward to claim it again to start a streak

reward_streaks: true # false to disable this feature

The time how long the players have to wait before claiming their rewards again

The time is in seconds

86400 seconds is one day

Each permission group has its own waiting time

wait_time: default: 86400 vip: 86400 vip+: 86400

These are the commands which will be executed if the players get their rewards

The commands will be executed through the console

{player} is the player who claimed his reward, {asplayer} to run the command as the player

IMPORTANT: Use " instead of normal quotes

Each permission group has its own commands

You can set up rewards for different streaks

The default strike is 0

Don't forget to set up 'max', which is the highest possible streak

A missing streak reward will be replaced with the max reward

commands: default: 1:

  • "givemoney {player} 5000"
  • "key Daily 1 {player}" max:
  • "givemoney {player} 5000"
  • "key Daily 1 {player}" vip: 1:
  • "givemoney {player} 10000"
  • "key Daily 1 {player}"
  • "key Money 1 {player}" max:
  • "givemoney {player} 10000"
  • "key Daily 1 {player}"
  • "key Money 1 {player}" vip+: 1:
  • "givemoney {player} 15000"
  • "key Daily 1 {player}"
  • "key Money 1 {player}" max:
  • "givemoney {player} 15000"
  • "key Daily 1 {player}"
  • "key Money 1 {player}"

The /reward command

command: command: "daily" description: "Take daily rewards" usage: "/daily" aliases: [""] ...

NdaruAjaa avatar Nov 02 '23 08:11 NdaruAjaa

Are you using the latest version for Rewards? I'm unable to reproduce your issue.

Wertzui123 avatar Nov 02 '23 11:11 Wertzui123

Yes, I use the latest version of the rewards plugin

NdaruAjaa avatar Nov 02 '23 12:11 NdaruAjaa

Which permission group is the player who caused the crash part of?

Wertzui123 avatar Nov 02 '23 13:11 Wertzui123

I don't know, most likely I made a mistake in the config

NdaruAjaa avatar Nov 02 '23 13:11 NdaruAjaa

Ok, I was actually able to reproduce it now. Try adding a space before the vip+ in the commands sections, so it looks like this:

commands:
 default:
  1:
   - "givemoney {player} 5000"
   - "key Daily 1 {player}"
  max:
   - "givemoney {player} 5000"
   - "key Daily 1 {player}"
 vip:
  1:
   - "givemoney {player} 10000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
  max:
   - "givemoney {player} 10000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
 vip+:
  1:
   - "givemoney {player} 15000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
  max:
   - "givemoney {player} 15000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"

Wertzui123 avatar Nov 02 '23 16:11 Wertzui123

Did this fix it?

Wertzui123 avatar Apr 10 '25 10:04 Wertzui123

I've been away from pocketmine for a long time, I'll try it later if I have time

NdaruAjaa avatar Apr 10 '25 11:04 NdaruAjaa

thank you it worked

NdaruAjaa avatar Apr 14 '25 01:04 NdaruAjaa

Nice, thanks for testing!

Wertzui123 avatar Apr 14 '25 11:04 Wertzui123