当前位置: 首页>>代码示例>>Java>>正文


Java EnderTeleportEvent.getEntity方法代码示例

本文整理汇总了Java中net.minecraftforge.event.entity.living.EnderTeleportEvent.getEntity方法的典型用法代码示例。如果您正苦于以下问题:Java EnderTeleportEvent.getEntity方法的具体用法?Java EnderTeleportEvent.getEntity怎么用?Java EnderTeleportEvent.getEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.event.entity.living.EnderTeleportEvent的用法示例。


在下文中一共展示了EnderTeleportEvent.getEntity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enderPearlTeleport

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void enderPearlTeleport(EnderTeleportEvent ev) {
	if (ev.getEntity().getEntityWorld().isRemote || !(ev.getEntity() instanceof EntityPlayerMP)) {
		return;
	}
	EntityPlayerMP player = (EntityPlayerMP) ev.getEntity();
	if (isWearingEnderBoots(player)) {
		ev.setAttackDamage(0.01f);
		damageEnderBoots(player);
	}
}
 
开发者ID:ToroCraft,项目名称:TeleToro,代码行数:12,代码来源:Teletory.java

示例2: onEnderTeleport

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEnderTeleport(EnderTeleportEvent event){
	if(event.getAttackDamage()>0&&event.getEntity()instanceof EntityPlayer){
		ItemStack armor=((EntityPlayer)event.getEntity()).inventory.armorInventory[0];
		if(armor!=null&&armor.getItem() instanceof ItemArmor&&((ItemArmor) armor.getItem()).getArmorMaterial()==ArmorMaterials.Terminium){
			event.setAttackDamage(0);
		}
	}
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:10,代码来源:EventHandler.java

示例3: onEnderTeleportEvent

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEnderTeleportEvent(EnderTeleportEvent event) {
  if (mountedPearl) {
    Entity rider = event.getEntity();
    if (rider != null && rider instanceof EntityPlayer && rider.getRidingEntity() != null) {
      EntityPlayer playerRider = (EntityPlayer) rider;
      Entity maybeHorse = playerRider.getRidingEntity();
      //take the players horse and set its position to the target
      event.getEntity().getRidingEntity().setPositionAndUpdate(event.getTargetX(), event.getTargetY(), event.getTargetZ());
      playerRider.getEntityData().setInteger(KEY_MOUNTENTITY, maybeHorse.getEntityId());
    }
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:14,代码来源:MountedTweaksModule.java

示例4: onEnderTeleportEvent

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEnderTeleportEvent(EnderTeleportEvent event) {
  Entity ent = event.getEntity();
  if (ent instanceof EntityLivingBase == false) {
    return;
  }
  EntityLivingBase living = (EntityLivingBase) event.getEntity();
  if (living.isPotionActive(this)) {
    event.setAttackDamage(0);
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:12,代码来源:PotionEnder.java

示例5: handleTeleportEvent

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
/**
 * Most generic handling of EnderTeleportEvent
 *
 * @param event to handle
 * @return true only if the event is not cancelled
 */
private boolean handleTeleportEvent(EnderTeleportEvent event){
    if (!MinecraftForge.EVENT_BUS.post(event)) {
        for (int i = 0; i < 32; ++i){
            this.world.spawnParticle(EnumParticleTypes.PORTAL, event.getTargetX(), event.getTargetY() + this.rand.nextDouble() * 2.0D, event.getTargetZ(), this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian());
        }
        event.getEntity().dismountRidingEntity();
        event.getEntity().setPositionAndUpdate(event.getTargetX(), event.getTargetY(), event.getTargetZ());
        event.getEntity().fallDistance = 0.0F;
        event.getEntity().attackEntityFrom(getEnderDamage(), event.getAttackDamage());
        return true;
    }
    return false;
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:20,代码来源:EntityEnderArrow.java

示例6: stopEndermanTeleporting

import net.minecraftforge.event.entity.living.EnderTeleportEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void stopEndermanTeleporting(EnderTeleportEvent e){
    if((e.getEntity() instanceof EntityEnderman || e.getEntity() instanceof EntityShulker) && ConfigurationFile.stopMobsFromTeleporting){
        e.setCanceled(true);
    }
}
 
开发者ID:baileyholl,项目名称:Event-Tweaks,代码行数:7,代码来源:MobEventHandler.java


注:本文中的net.minecraftforge.event.entity.living.EnderTeleportEvent.getEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。