48 if(count($args) !== 1){
52 $difficulty = World::getDifficultyFromString($args[0]);
54 if($sender->getServer()->isHardcore()){
55 $difficulty = World::DIFFICULTY_HARD;
58 if($difficulty !== -1){
59 $sender->getServer()->getConfigGroup()->setConfigInt(ServerProperties::DIFFICULTY, $difficulty);
62 foreach($sender->getServer()->getWorldManager()->getWorlds() as $world){
63 $world->setDifficulty($difficulty);
66 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_difficulty_success((
string) $difficulty));