Okay, so I tried to run my server with the first plugin I ever created. I got this error:
Cannot find main class 'com.gmail.eanwowmaster.Eancraft'
Here is my plugin.yml file:
And here is my source code:
I do not know what is causing the error or how to fix it. The bukkit forums have had this "Post awaiting moderation" message for hours.
Cannot find main class 'com.gmail.eanwowmaster.Eancraft'
Here is my plugin.yml file:
Click to reveal
name: Eancraft
main: com.gmail.eanwowmaster.Eancraft
version: 1
main: com.gmail.eanwowmaster.Eancraft
version: 1
And here is my source code:
Click to reveal
package com.gmail.eanwowmaster;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectTypeWrapper;
import org.bukkit.potion.PotionType;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import java.util.Random;
public class Eancraft extends JavaPlugin {
Random randomEancraft = new Random();
@Override
public void onEnable() {
getLogger().info("Eancraft plugin enabled!");
}
@Override
public void onDisable() {
getLogger().info("Eancraft plugin disabled!");
}
public void magicDrop(PlayerDropItemEvent evt) {
PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, 10, 2, true);
PotionEffect strength = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 10, 1, true);
PotionEffect jump = new PotionEffect(PotionEffectType.JUMP, 10, 3, true);
PotionEffect heal = new PotionEffect(PotionEffectType.HEAL, 1, 5, true);
Player player = evt.getPlayer();
Item item = evt.getItemDrop();
if (player.getLocation().getWorld().getName().equals("superSmashCake") || player.getLocation().getWorld().getName().equals ("superSmashEthereal") || player.getLocation().getWorld().getName ().equals ("superSmashFinal") || player.getLocation().getWorld().getName().equals ("superSmashNether")) {
if (evt.getItemDrop() == item) {
player.sendMessage("You activated your Power Emerald!");
evt.setCancelled(true);
player.addPotionEffect(speed);
player.addPotionEffect(strength);
} else if (evt.getItemDrop() == item) {
int isDiamond = randomEancraft.nextInt(2);
if (isDiamond == 0) {
player.sendMessage("It's just a piece of coal...");
} else if (isDiamond == 1) {
player.sendMessage("You found a diamond within your coal!");
evt.setCancelled(true);
player.addPotionEffect(heal);
}
}
}
}
}
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectTypeWrapper;
import org.bukkit.potion.PotionType;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import java.util.Random;
public class Eancraft extends JavaPlugin {
Random randomEancraft = new Random();
@Override
public void onEnable() {
getLogger().info("Eancraft plugin enabled!");
}
@Override
public void onDisable() {
getLogger().info("Eancraft plugin disabled!");
}
public void magicDrop(PlayerDropItemEvent evt) {
PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, 10, 2, true);
PotionEffect strength = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 10, 1, true);
PotionEffect jump = new PotionEffect(PotionEffectType.JUMP, 10, 3, true);
PotionEffect heal = new PotionEffect(PotionEffectType.HEAL, 1, 5, true);
Player player = evt.getPlayer();
Item item = evt.getItemDrop();
if (player.getLocation().getWorld().getName().equals("superSmashCake") || player.getLocation().getWorld().getName().equals ("superSmashEthereal") || player.getLocation().getWorld().getName ().equals ("superSmashFinal") || player.getLocation().getWorld().getName().equals ("superSmashNether")) {
if (evt.getItemDrop() == item) {
player.sendMessage("You activated your Power Emerald!");
evt.setCancelled(true);
player.addPotionEffect(speed);
player.addPotionEffect(strength);
} else if (evt.getItemDrop() == item) {
int isDiamond = randomEancraft.nextInt(2);
if (isDiamond == 0) {
player.sendMessage("It's just a piece of coal...");
} else if (isDiamond == 1) {
player.sendMessage("You found a diamond within your coal!");
evt.setCancelled(true);
player.addPotionEffect(heal);
}
}
}
}
}
I do not know what is causing the error or how to fix it. The bukkit forums have had this "Post awaiting moderation" message for hours.
