Question Break event

Discussion in 'Bukkit Help' started by hopstar, Feb 11, 2015.

Thread Status:
Not open for further replies.
  1. Offline



    Im im creating a plugin. The purpuse of the plugin is to let a player mine a ore.
    atm that the ore is mined the player should get a iron ingot, and the ore should be replaced with stone.

    Here is my code. it breaks the block, but it won't drop any items or create a new block.

    package com.hopstar.oreUpdate;

    import org.bukkit.Bukkit;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockBreakEvent;

    public final class oreUpdate extends JavaPlugin implements Listener {

    public void onEnable(){
    Bukkit.getPluginManager().registerEvents(this, this);
    public void eventBreakIron(BlockBreakEvent event) {
    Block block = event.getBlock();
    Player player = event.getPlayer();
    final World world = player.getWorld();
    int x,y,z;
    x = block.getX();
    y = block.getY();
    z = block.getZ();

Thread Status:
Not open for further replies.

Share This Page