This is possible with KtSkript, use the following script:
onPlayerJoin {
Server.console.executeCommand("give ${player.name} minecraft:cookie 3")
}
Or use this more sophisticated approach from here:
onPlayerJoin {
val commands = listOf(
"nucleus:warp ${player.name} main-spawn",
"give ${player.name} minecraft:cookie 3"
)
commands.forEach { command ->
Server.console.executeCommand(command)
}
}