本文整理汇总了Java中net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent.getEntityLiving方法的典型用法代码示例。如果您正苦于以下问题:Java LivingJumpEvent.getEntityLiving方法的具体用法?Java LivingJumpEvent.getEntityLiving怎么用?Java LivingJumpEvent.getEntityLiving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent
的用法示例。
在下文中一共展示了LivingJumpEvent.getEntityLiving方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEntityJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event){
EntityLivingBase ent = event.getEntityLiving();
World world = ent.world;
if(!world.isRemote){
//basically, check if we are standing on placed dust, then check if its an active rune of bouncing
BlockPos feetPos = ent.getPosition();
IBlockState state = world.getBlockState(feetPos);
if(state.getBlock()==WizardryRegistry.dust_placed){
TileEntity te = world.getTileEntity(feetPos);
if(te instanceof TileEntityDustPlaced){
TileEntityDustPlaced ted = (TileEntityDustPlaced)te;
RuneEntity rune = ted.getRune();
if(rune instanceof RuneEntityBouncing){
ent.addVelocity(0, 1D, 0);
ent.velocityChanged=true;
}
}
}
}
}
示例2: onEntityJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event)
{
PotionEffect effect = event.getEntityLiving().getActivePotionEffect(PotionRegistry.REDSTONE_NEEDLE);
if (effect == null)
return;
if (effect.getAmplifier() >= 4)
{
EntityLivingBase living = event.getEntityLiving();
living.motionX = 0;
living.motionY = -1;
living.motionZ = 0;
living.isAirBorne = false;
living.setPosition(living.prevPosX, living.prevPosY, living.prevPosZ);
}
}
示例3: onPlayerJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
if (!(event.getEntityLiving() instanceof EntityPlayer))
return;
EntityPlayer player = (EntityPlayer)event.getEntityLiving();
if (player.getActivePotionEffect(MobEffects.SLOWNESS) != null && player.getActivePotionEffect(MobEffects.SLOWNESS).getAmplifier() >= 4)
player.motionY = 0;
}
示例4: onLivingJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event)
{
if (event.getEntityLiving() != null)
{
if (event.getEntityLiving().isPotionActive(ExPPotions.stunned))
{
event.getEntityLiving().motionY -= 10;
}
}
}
示例5: onJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onJump(LivingJumpEvent event){
EntityLivingBase ent = event.getEntityLiving();
if(ent instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)ent;
ItemStack worn = DustRegistry.getWornInscription(player);
if(!player.isSneaking()&&DustRegistry.getInscriptionFromStack(worn)==this){
//player.jumpMovementFactor=1.5F;
player.addVelocity(0, 0.025, 0);
player.velocityChanged=true;
}
}
}
示例6: jumpHeight
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void jumpHeight(LivingJumpEvent event){
if(event.getEntityLiving() == null) return;
ItemStack legs = event.getEntityLiving().getItemStackFromSlot(EntityEquipmentSlot.LEGS);
if(ItemStackTools.isValid(legs)){
if(ModEnhancements.JUMP_BOOST.isApplied(legs)){
event.getEntityLiving().motionY +=0.21;
}
}
}
示例7: onEntityJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event)
{
PotionEffect effect = event.getEntityLiving().getActivePotionEffect(PotionRegistry.STUN);
if (effect == null) return;
EntityLivingBase living = event.getEntityLiving();
living.motionX = 0;
living.motionY = -1;
living.motionZ = 0;
living.isAirBorne = false;
living.setPosition(living.prevPosX, living.prevPosY, living.prevPosZ);
}
示例8: onPlayerJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event)
{
if (event.getEntityLiving() instanceof EntityPlayer) {
EntityPlayer p = (EntityPlayer) event.getEntityLiving();
if (WeightsConfig.isEnabled && (!p.capabilities.isCreativeMode || WeightsConfig.allowInCreative) && ARKPlayer.get(p).isEncumbered()) {
p.motionY *= 0;
if (p.world.isRemote)
p.sendMessage(new TextComponentTranslation("ark.splash.noJump"));
}
}
}
示例9: onJump
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onJump (LivingJumpEvent event) {
if (event.getEntityLiving() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
if(player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() == 0){
player.motionY=-0.0001;
}
}
}