Help with plugin

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 :sweat_smile:

Some help would be appreciated :wink:

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.