Hardcore not working

ive been trying to set up a hard core world by importing a world that is hard core and it didnt work, i also tried setting up a new world but i didnt see an option to select hard core. can anyone help?

Can you check the …/server-name/server.properties file and make sure that the following lines are:

force-game mode: true
hardcore: true
difficulty: (0-3)

For a better explanation, this is documented on the Minecraft Wiki.

You can do this form the server terminal post upload, or edit it before uploading the world file to the server.

Note: Keep in mind that these lines may not be in order as described here or in the Wiki.

this worked for me.