Hello :)
Now they cannot harrass you on singleplayer so I'm assuming this is over a server. Server's have staff you will see in game such as [Admin], [Op], [Mod], [Owner], [Intern]. These players can ban/mute the player harrassing you, so I'd advise to get them to ban or mute them. If they do not want to then just quit that server because they are lazy and generally idiots. If it's your own server simply do /ban (username). Problem solved. :)
Thanks, JreconTV