To detect the nether star, in my opinion it is best to make an item sorter. This can be made to only accept one type of item (in your case a nether star). If you place a repeater against a hopper, it will generate a signal whenever there is an item going through it. You can use this item to control a command block.
The command to teleport someone to a given location (if you know the coordinates) is /tp @p <x> <y> <z>
, with @p
denoting the player who is the closest to the command block. You replace <x>
<y>
and <z>
by the coordinates you want the player to teleport to.
To clear the inventory of a player, you use the following command: /clear @p
. In the same way as the last command, it will clear the inventory of the player who is the closest to the command block.
Source: https://minecraft.gamepedia.comhttps://minecraft.wiki and a 5 minute Google search