--This is provided as a super basic example of a task that only needs to be punched to gain XP.

minetest.register_node('tasks:example_0', { --This node is inactive, so somebody completed the task.
   description = 'example',
   tiles = {name='task_1.png'},
   groups = {breakable=1, not_in_creative_inventory=1, tasks=1},
   light_source = 14,
   on_construct = tasks.on_construct,
   on_timer = function(pos)
      local this_node = minetest.get_node(pos)
      minetest.swap_node(pos, {name = 'tasks:example_1', param2 = this_node.param2})
   end,
   on_punch = function(pos)
      local meta = minetest.get_meta(pos)
      local time_min = meta:get_int('time_min') or 60
      local time_max = meta:get_int('time_max') or 120
      local timer = minetest.get_node_timer(pos)
      local random_number = math.random(time_min, time_max)
      timer:start(random_number*2)
   end,
})

minetest.register_node('tasks:example_1', { --This node is waiting for somebody to come along and complete the task.
   description = 'example',
   tiles = {name='task_1.png'},
   groups = {breakable=1, not_in_creative_inventory=1, tasks=1},
   light_source = 2,
   drop = 'tasks:example_0',
   on_punch = function(pos, node, puncher, pointed_thing)
      tasks.add_xp(pos, node, puncher, 'tasks:example_0') --Everything is pulled from the node meta expect for what node to swap to.
   end
})
