Hey guys,
I am doing plugin practices and got stuck trying to figure out how to test for the surface (trying to make a /up command)
I crashed my server many times creating loops
Some help would be appreciated
Hey guys,
I am doing plugin practices and got stuck trying to figure out how to test for the surface (trying to make a /up command)
I crashed my server many times creating loops
Some help would be appreciated
You could do something like this BUKKIT - Check for block under player. Change some things (up instead of down and use Sponge instead of Bukkit) and it should work (I think).
So would some code - we have no idea what your loops are doing to crash the server.
But thatβs a simple check of whether a block is under the player - @PyroZ is asking for a way to get to the upper surface.
Let me rephrase what I have said shall I:
Take a look at this stack overflow question, instead of checking for blocks under the player, check for blocks above the player (move the location up 1 at the time). If there is a block above the player, teleport the player above that block (which would be y+2).
And as @pie_flavor said, show some of the code you have tried.
(better Adam?)
You could (and likely will) teleport a player into a block and make him suffocate using that code. I am looking for code that will teleport the player to the highest block. I actually just figured out a way to do it, iβll try it soon.