Thread: Java help.

Results 1 to 1 of 1
  1. #1
    Bumboxe's Sheep's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    C++
    Posts
    1,336
    Reputation
    54
    Thanks
    101
    My Mood
    Amused

    Java help.

    Ok lets face it. Coders lounge is dead so I came here for some help. Getting an error on Line 33 on send message, and I cant figure out why? The code isnt finished I just came here for some help.

    Update: It says the string for sendMessage(String) is undefined... Im just so confused. New to this so any help will do.

    Update 2: Oh Fuck im such an idiot. Sorry I fucked up real bad. Will reply with update if I fixed it but for now if you can find out what im doing wrong plz help.

     
    Code:
    package me.danielporsh.BedRock2Cake;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockPlaceEvent;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin implements Listener{
    	
    	public void onEnable() {
    		
    		getLogger().info(ChatColor.RED + "[BedRock2Cake] " + ChatColor.AQUA + "Plugin Has Been Enabled");
    		
    		PluginManager pm = Bukkit.getPluginManager();
    		pm.registerEvents(this, this);
    
    	}
    	
        @eventHandler
    	
    	public void onBlockPlace(BlockPlaceEvent event) {
    		Material block = event.getBlock().getType();
    		Player player = event.getPlayer();
    		
    		for(Material blocked : banList) {
    			if (blocked == block) {
    				if (player.isOp()){
    					player.getName().sendMessage(ChatColor.DARK_RED + "You Have Placed Bedrock");
    				}
    			}
    		}
    	}
    	
    	public void onDisable() {
    		getLogger().info(ChatColor.RED + "[BedRock2Cake] " + ChatColor.AQUA + "Plugin Has Been Disabled");
    	}
    
    }

    - - - Updated - - -

    Update.... I figured it out. I added .getName on accident and It was a double and it kept on giving me that error. Please Close. @arunforce @Saboteur Or Master @Boombox
    Last edited by Bumboxe's Sheep; 08-07-2015 at 12:05 PM.


    https://www.mpgh.net/forum/signaturepics/sigpic1320452_1.gif





Similar Threads

  1. [Help Request] Need Java help, again!
    By Chris in forum Minecraft Help
    Replies: 7
    Last Post: 08-31-2013, 10:47 AM
  2. [Help Request] Java help
    By Chris in forum Minecraft Help
    Replies: 2
    Last Post: 08-24-2013, 01:13 PM
  3. [Help Request] JAVA Help request... GUI related
    By hamste in forum Minecraft Help
    Replies: 6
    Last Post: 06-27-2013, 08:59 PM
  4. [Help Request] Java help please?
    By hamste in forum Minecraft Help
    Replies: 7
    Last Post: 06-08-2013, 10:16 PM
  5. [Help Request] Heya java help
    By molina174 in forum Minecraft Help
    Replies: 3
    Last Post: 05-09-2011, 10:48 PM