Changing block

Hey people of Nukkit, I just started making Nukkit plugins, I know Java, I've also created Alot of bukkit plugins, But I now have a problem changing a block type, I tried
Block b = p.getTargetBlock(50); //this works
and then I tried stuff like
b.setType and stuff but it doesn't recognize it, do you guys know if there is a way??


my code so far:
package me.savage.nukkit;

import java.util.Random;

import cn.nukkit.Player;
import cn.nukkit.block.Block;
import cn.nukkit.entity.Entity;
import cn.nukkit.event.Listener;
import cn.nukkit.event.entity.CreatureSpawnEvent;
import cn.nukkit.event.player.PlayerJoinEvent;
import cn.nukkit.event.player.PlayerMoveEvent;
import cn.nukkit.plugin.PluginBase;
import cn.nukkit.utils.TextFormat;

public class Main extends PluginBase implements Listener{
private Random r = new Random();

@Override
public void onEnable() {
this.getLogger().info(TextFormat.GREEN + "plugin enabled!");
this.getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
Block b = p.getTargetBlock(50);



}
}
 
Last edited:
Top