How do I get the block that a player has broken?

Discussion in 'Bukkit Help' started by xCyclonez, Apr 14, 2017.

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

    xCyclonez

    package com.xcyclonez.chestdrop.commands;

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

    import net.minecraft.server.v1_10_R1.Block;

    public class _________ implements Listener{

    @EventHandler public void onBlockBreak(BlockBreakEvent e){
    Player p = e.getPlayer();
    if(e.getBlock().getType().equals(Material.Stone});

    This code is giving me errors. I'm also not sure if this is correct.
     
  2. Offline

    Zombie_Striker

  3. Offline

    xCyclonez

    @Zombie_Striker I'm still on 1.10 because I develop for a server that is 1.10.

    I'm also not sure how to get the block that the player has just broken.



    BTW, I also copied that if statement...
     
  4. Offline

    timtower Administrator Administrator Moderator

    @xCyclonez That is because you are using a } in your code on a place where you can't use that.
    Not to mention that you if statement doesn't do anything with that semicolon behind it and that enums should be compared with ==
     
  5. @xCyclonez You do not own xcyclonez.com please keep to java naming conventions and change your package declaration to me.xcyclonez
     
  6. Offline

    xCyclonez

    Again, I'm asking about how to get the block that a player has broken. I know the if statement is wrong, and how to fix it.
     
  7. Offline

    Zombie_Striker

  8. Offline

    RcExtract

    Try to use command block. It maybe easier for u.
     
  9. Offline

    Zombie_Striker

    @RcExtract
    Do not recommend command blocks on the bukkit forums. Not only are commands blocks far more inefficient that bukkit, but this is a place for helping users with plugins.
     
  10. They can do stuff that would be a lot trickier in code. (Remember my commands and Booleans thread?)
     
    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page