game.GetSkillLevel
Description
Returns the difficulty level of the game.
TIP: You can use this function in your scripted NPCs or Nextbots to make them stronger, however, it is a good idea to lock powerful attacks behind the highest difficulty instead of just increasing the health.
Internally this is tied to the gamerules entity, so you'll have to wait until GM:InitPostEntity is called to return the skill level