Jump to content

Recommended Posts

Posted

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

Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...