Program Minecraft plugin to recognize if player is on an edge of the block?

Za
- in Plugins
10

I'm currently programming a Minecraft TNTRun plugin, the blocks and so are all removed, but there's a bug, if I fall on the edge of a block it will not be removed. Attached is a picture and the code. Thanks in advance! And no, unfortunately there's no barrier underneath, that is strange!

Program Minecraft plugin to recognize if player is on an edge of the block

if (Manager.isState (Manager.INGAME)) {
Player p = e.getPlayer ();
if (p.getLocation (). Subtract (0.0D, 1.0D, 0.0D) .getBlock (). GetType () == Material.TNT) {
Block block = p.getLocation (). Subtract (0.0D, 1.0D, 0.0D) .getBlock ();
Reseter.locations.add (p.getLocation (). Subtract (0.0D, 1.0D, 0.0D));
Bukkit.getScheduler (). ScheduleSyncDelayedTask (pl, new Runnable (
) {
@Override
public void run () {
block.setType (Material.AIR);
p.playEffect (p.getLocation (). Subtract (0.0D, 1.0D, 0.0D), Effect.SMOKE, 1);

}
}, 5);

An

This is Minecraft physics…

but I'm just looking for a solution with a moment

Za

Thank you

Au

I would choose the player's location more generously. So not a dot but a small square.

Then get all the blocks that touch this square and make them disappear.

If you then fall on a corner or corner, 2 or 4 blocks disappear so that you fall.

Za

Thank you.

Au

If necessary, read the size of the player's collision box and use it as a basis.

Za

OK

An

Screw down the player location that is too high. If that doesn't work I would have an idea that has to do with Vanilla and I have less with a plugin for my server too

Za

OK thanks

Za

Still does not work:/

Co

I don't know how developed you are as far as programmers are concerned, if you are not ready, I would say that it is not possible. But if you are familiar with Java, you can calculate everything