Create Block HELP please!

Discussion in 'Plugin Development' started by desup, Dec 12, 2011.

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

    desup

    Hi, Ive just put together two pieces of code
    One from user yottabyte
    One From Tent plugin.
    There it is:
    Code:
        public void onPlayerInteract(PlayerInteractEvent event){
            Player player = event.getPlayer();
            if(event.getAction() == Action.RIGHT_CLICK_BLOCK){
                Block b = event.getClickedBlock();
                if(b.getType() == Material.SIGN_POST){
                      if(((Sign)b.getState()).getLines()[0].equals("[BARAK]")){
                          for(int q = 1;q <= 3; q++){
                                Block newBlock = player.getWorld().getBlockAt(b.getX(), b.getY()+q, b.getZ());
                                newBlock.setTypeId(49);
     
        }
                }
            }
        }
    It should(I think) create 3 block of obsidian onclick on the Sign, but if i do this, There is just simple message appeared in chat: diff.
    Can you help little , san noob that want to make at least one plugin? :D
    Thanks
     
  2. Offline

    coldandtired

    You're missing one } at the end but it will work.
     
  3. Offline

    desup

    Ive added one, but still.. there is just an message diff in the chat window.. but nothing more
     
  4. Offline

    coldandtired

    That's nothing to do with this code though. The code above (once you add that } ) does exactly what it should do. No idea where that message is coming from, either somewhere else in your code or another plugin.
     
Thread Status:
Not open for further replies.

Share This Page