Hello! I am trying to make an item with an ability similar to the Aspect of the End in Hypixel Skyblock, however the way I am currently making it, the player will always teleport to the block 5 blocks ahead of them, however, if there is a block occupying that place, the player will become stuck in the wall and suffocate. Is there a way to make it so that the teleportation stops at the first solid block within range of the teleportation, so the player is not suffocated? Thanks!
Here is my current code:
on right click:
if name of player's held item is "&5Teleportation Wand":
set {_waited} to difference between {cooldown::%player%::Teleport} and now
if {_waited} is less than 1 seconds:
send "&cYou can use &6Teleport &cagain in %difference between {_waited} and 1 seconds%"
else:
set {cooldown::%player%::Teleport} to now
set {_loc} to location 5 blocks in front of player
teleport player to {_loc}
Here is my current code:
on right click:
if name of player's held item is "&5Teleportation Wand":
set {_waited} to difference between {cooldown::%player%::Teleport} and now
if {_waited} is less than 1 seconds:
send "&cYou can use &6Teleport &cagain in %difference between {_waited} and 1 seconds%"
else:
set {cooldown::%player%::Teleport} to now
set {_loc} to location 5 blocks in front of player
teleport player to {_loc}