Jump to content

need some help with a plugin


Recommended Posts

hey! im creating a plugin for tekkit wich does the following:

  1. someone places a nuke, nova catalyst, nova catalysm or any other explosive
  2. when he places, he automaticly says: "Hey! i just placed a nuke!!)

now i need someone to check if this code will work.

package com.gmail.fondelaar.nukenotify;

 

import org.bukkit.Material;

import org.bukkit.block.Block;

import org.bukkit.entity.Player;

import org.bukkit.event.block.BlockPlaceEvent;

import org.bukkit.plugin.java.JavaPlugin;

 

public class Nukenotify extends JavaPlugin{

 

    public void onEnable(){

        getLogger().info ("notifying placed nukes now!");{

           

        }

    }

    public void onDisable(){

        getLogger().info("Disabling Nukenotify");{

           

        }

    }

   

    public void onBlockPlace(BlockPlaceEvent event){

 

        if (event.getBlock().getType() == Material.X237){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NUKE!");

           

            return;

 

            }

        if (event.getBlock().getType() == Material.X126:10){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NOVA CATALYST!");

           

            return;

 

            }

        if (event.getBlock().getType() == Material.X126:11){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NOVA CATALYSM!");

           

            return;

 

            }

        if (event.getBlock().getType() == Material.X239){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed INDUSTRIAL TNT!!");

           

            return;

 

            }

    }

}

normally i would ask such questions at the bukkit forums but they told me they wont help me since its made for tekkit..

also, do i need to insert the bukkit 1.2.5R1.3 or the tekkit.jar?

please help me!!!one!! i kinda want more tekkit plugins

Link to comment
Share on other sites

ok i made some progress, but it still doesnt work.

package com.gmail.fondelaar.nukenotify;

 

import org.bukkit.Material;

import org.bukkit.block.Block;

import org.bukkit.entity.Player;

import org.bukkit.event.block.BlockPlaceEvent;

import org.bukkit.plugin.java.JavaPlugin;

 

public class Nukenotify extends JavaPlugin{

 

    public void onEnable(){

        getLogger().info ("notifying placed nukes now!");{

           

        }

    }

    public void onDisable(){

        getLogger().info("Disabling Nukenotify");{

           

        }

    }

   

    public void onBlockPlace(BlockPlaceEvent event){

 

        if(block.getTypeId() == 126 && block.getDurability() == 10){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NUKE!");

           

            return;

 

            }

        if(block.getTypeId() == 126 && block.getDurability() == 10){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NOVA CATALYST!");

           

            return;

 

            }

        if(block.getTypeId() == 126 && block.getDurability() == 10){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed a NOVA CATALYSM!");

           

            return;

 

            }

        if(block.getTypeId() == 126 && block.getDurability() == 10){

 

            Player player = event.getPlayer();

 

            player.chat("Hey, I just placed INDUSTRIAL TNT!!");

           

            return;

 

            }

    }

}

im also getting help at http://forums.bukkit.org/threads/using-block-ids-and-not-block-names.82388/#post-1177354

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...