本文整理汇总了Java中org.bukkit.entity.Witch类的典型用法代码示例。如果您正苦于以下问题:Java Witch类的具体用法?Java Witch怎么用?Java Witch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Witch类属于org.bukkit.entity包,在下文中一共展示了Witch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPotionSplash
import org.bukkit.entity.Witch; //导入依赖的package包/类
/**
* Patching witch's potions
*
* @param event Event
*/
@EventHandler
public void onPotionSplash(PotionSplashEvent event)
{
ThrownPotion potion = event.getPotion();
if (potion.getShooter() instanceof Witch)
{
event.setCancelled(true);
List<PotionEffectType> potionEffects = new ArrayList<>();
potionEffects.add(PotionEffectType.SLOW_DIGGING);
potionEffects.add(PotionEffectType.CONFUSION);
potionEffects.add(PotionEffectType.NIGHT_VISION);
potionEffects.add(PotionEffectType.HUNGER);
potionEffects.add(PotionEffectType.BLINDNESS);
PotionEffect selected = new PotionEffect(potionEffects.get(new Random().nextInt(potionEffects.size())), 20 * 15, 1);
for (LivingEntity ent : event.getAffectedEntities())
ent.addPotionEffect(selected);
}
}
示例2: onEntityBendingDeath
import org.bukkit.entity.Witch; //导入依赖的package包/类
@EventHandler
public void onEntityBendingDeath(EntityBendingDeathEvent event) {
Entity v = event.getVictim();
Element e = CoreAbility.getAbility(event.getAbility()).getElement();
int xp;
if(v == null || e == null)
return;
if(v instanceof Player) {
xp = 25 + (int)(Math.random() * ((35 - 25) + 1));
}
else if(v instanceof Zombie || v instanceof Creeper || v instanceof Witch || v instanceof Skeleton || v instanceof Guardian || v instanceof Spider) {
xp = 13 + (int)(Math.random() * ((22 - 13) + 1));
}
else {
xp = 3 + (int)(Math.random() * ((8 - 3) + 1));
}
BendingExp.addExp(event.getAttacker(), e, xp);
}
示例3: speech
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speech(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string1);
speechPt2(p, witch, loc);
}
}, 60L);
}
示例4: speechPt2
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt2(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string2);
speechPt3(p, witch, loc);
}
}, 60L);
}
示例5: speechPt3
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt3(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string3);
speechPt4(p, witch, loc);
}
}, 60L);
}
示例6: speechPt4
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt4(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string4);
speechPt5(p, witch, loc);
}
}, 60L);
}
示例7: speechPt5
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt5(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string5);
speechPt6(p, witch, loc);
}
}, 60L);
}
示例8: speechPt6
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt6(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string6);
speechPt7(p, witch, loc);
}
}, 60L);
}
示例9: speechPt7
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt7(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string7);
speechPt8(p, witch, loc);
}
}, 60L);
}
示例10: speechPt8
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt8(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string8);
speechPt9(p, witch, loc);
}
}, 60L);
}
示例11: speechPt9
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void speechPt9(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string9);
witch.remove();
GrinchListener.createTornado(loc.subtract(0,1,0), p);
}
}, 60L);
}
示例12: spawnGrinchWitch
import org.bukkit.entity.Witch; //导入依赖的package包/类
public static void spawnGrinchWitch(final Player p, final Block b){
final Location bLoc = b.getLocation().add(0,1,0);
final World w = p.getWorld();
final Witch witch = (Witch)w.spawnEntity(bLoc, EntityType.WITCH);
witch.setCanPickupItems(false);
witch.setCustomName(ChatColor.GREEN + "The Grinch!");
witch.setRemoveWhenFarAway(false);
witch.setMaxHealth(200.0);
witch.setHealth(200.0);
witch.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100000, 100000));
GrinchSpawnSpeech.speech(p, witch, bLoc);
}
示例13: CanaryWitch
import org.bukkit.entity.Witch; //导入依赖的package包/类
public CanaryWitch(net.canarymod.api.entity.living.monster.Witch entity) {
super(entity);
}
示例14: teleportCheck
import org.bukkit.entity.Witch; //导入依赖的package包/类
/** Checks that player is not trying to combatlog/is allowed to teleport
* Returns an error message to be displayed if the player is not allowed
* to teleport
* Returns null if the player is allowed to teleport
*/
private static String teleportCheck(Player player) {
Location pLoc = player.getLocation();
World world = player.getWorld();
/* Check if there are any players within 50 blocks */
for (Player p : world.getPlayers()) {
if (!p.equals(player)
&& p.getLocation().distance(pLoc) < 50
&& player.canSee(p)
&& !p.isDead()) {
return ChatColor.RED + "You cannot use this command while within 50 blocks of any other players.";
}
}
/* Check if there are any hostile mobs within 5 blocks */
for (Entity entity : world.getEntitiesByClasses(
Blaze.class,
CaveSpider.class,
Creeper.class,
Enderman.class,
Ghast.class,
MagmaCube.class,
PigZombie.class,
Skeleton.class,
Silverfish.class,
Slime.class,
Spider.class,
Witch.class,
Zombie.class)) {
if (entity.getLocation().distance(pLoc) < 5) {
return ChatColor.RED + "You cannot use this command while within 5 blocks of any hostile mobs.";
}
}
/* Check if the player is falling */
if (player.getVelocity().getY() < -0.079
|| player.getVelocity().getY() > 0.08) {
return ChatColor.RED + "You cannot use this command while falling.";
}
/* Check if the player is burning */
if (player.getFireTicks() > 0
&& !player.hasPotionEffect(
PotionEffectType.FIRE_RESISTANCE)) {
return ChatColor.RED + "You cannot use this command while on fire.";
}
/* Default to allow teleport */
return null;
}
示例15: RemoteWitch
import org.bukkit.entity.Witch; //导入依赖的package包/类
public RemoteWitch(int inID, EntityManager inManager)
{
super(inID, RemoteEntityType.Witch, inManager);
}