How would I get the block the player's standing on?

I’m not sure if there is a method for that, so I’ll ask.

I assume that’d be:

enity.getLocation().getRelative(Direction.DOWN).something()

Can’t you just get the player’s location rounded to the lower value and get the block from this position?

I guess it would be like this:

Player player = game.getServer().getPlayer("Ekranos").get();
Location location = player.getLocation();
Vector3i position = location.getBlockPosition();
BlockState block = location.getExtent().getBlock(position.sub(0, 1, 0));

I just tested the following code and it works like a charm:

game.getCommandDispatcher().register(this,CommandSpec.builder()
     .setExecutor((src, args) -> {
        Player player = (Player) src;
        Location location = player.getLocation();
        Vector3i position = location.getBlockPosition();
        location.getExtent().setBlock(position.sub(0, 1, 0), BlockTypes.GOLD_BLOCK.getDefaultState());
        return CommandResult.empty();
    })
    .build(), "gold");

I wanted to do this with the PlayerMoveEvent but it seems like it isn’t implemented.