Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIN :
- package me.kyrp.MaxSpeedz;
- import org.bukkit.ChatColor;
- import org.bukkit.Server;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin {
- public void onDisable(){
- System.out.println("[MaxSpeedz] Disabled");
- }
- public void onEnable() {
- System.out.println("[MaxSpeedz] Enabled.");
- this.getServer().getPluginManager().registerEvents(new Events(), this); {
- }
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandText, String[] args){
- Player player = (Player)sender;
- if(sender instanceof Player){
- Server server = player.getServer();
- }
- if(cmd.getName().equalsIgnoreCase("bafk")){
- server.broadcastMessage(ChatColor.GOLD + playername + " is now AFK "); {
- return false;
- }
- }
- EVENTS:
- package me.kyrp.MaxSpeedz;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.Server;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.EventPriority;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.BlockPlaceEvent;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class Events implements Listener {
- @EventHandler(priority = EventPriority.NORMAL)
- public void onBlockPlace(BlockPlaceEvent event) {
- Player player = event.getPlayer();
- String playername = player.getName();
- Server server = player.getServer();
- Material material = event.getBlock().getType();
- server.broadcastMessage(ChatColor.GOLD + playername + " has placed: " + material);
- player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 7000, 6));
- player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 7000, 6));
- player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 7000, 6));
- player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 7000, 6));
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 7000, 6));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement