You are viewing our Forum Archives. To view or take place in current topics click here.
I need help with My Plugin
Posted:
I need help with My PluginPosted:
Status: Offline
Joined: Aug 12, 201113Year Member
Posts: 304
Reputation Power: 13
Status: Offline
Joined: Aug 12, 201113Year Member
Posts: 304
Reputation Power: 13
can someone please help me fix this part of the code i cant figure out whats wrong....I Highlighted the problem in red ....that piece of code keeps getting red squiggle line and i have no clue what im doing wrong.
I will Rep+ if you help.
package me.myname.classname;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
public class MutedPeople implements Listener {
public final HashMap<String, ArrayList<Block>> mutedPlayers new HashMap<String, ArrayList<Block>>
public static Bukkit plugin;
public void BukkitListener(Bukkit instance) {
plugin = instance;
}
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event){
Player player = event.getPlayer();
if(mutedPlayers.containsKey(player.getName())){
try{
event.setCancelled(true);
}catch (Exception e) {
event.setMessage("");
}
}
}
}
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
public class MutedPeople implements Listener {
public final HashMap<String, ArrayList<Block>> mutedPlayers new HashMap<String, ArrayList<Block>>
public static Bukkit plugin;
public void BukkitListener(Bukkit instance) {
plugin = instance;
}
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event){
Player player = event.getPlayer();
if(mutedPlayers.containsKey(player.getName())){
try{
event.setCancelled(true);
}catch (Exception e) {
event.setMessage("");
}
}
}
}
I will Rep+ if you help.
You are viewing our Forum Archives. To view or take place in current topics click here.