Hi guys!
Not sure if this code works...
Not sure if this code works...
package com.plugin.checkinv;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class CheckInv extends JavaPlugin{
public void onEnable() {
getServer().getPluginManager().registerEvents((Listener) this, this);
getLogger().info("BlockCheck has been enabled!");
}
public void onDisable() {
getLogger().info("BlockCheck has been disabled!");
}
public class LoginListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerJoin(PlayerJoinEvent evt) {
Player player = evt.getPlayer();
PlayerInventory inventory = player.getInventory();
if (inventory.contains(Material.BEDROCK)) {
inventory.remove(Material.BEDROCK);
player.sendMessage("Why do you have bedrock???");
}
}
}
}
1
Well why don't you try it and find out?
If it works, then you've removed the bedrock. So there's no sense in asking them why they have bedrock, because they don't have it anymore.
If it works, then you've removed the bedrock. So there's no sense in asking them why they have bedrock, because they don't have it anymore.
