net.minecraft.world.World.setEntityState()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中net.minecraft.world.World.setEntityState()方法的一些代码示例,展示了World.setEntityState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.setEntityState()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:setEntityState

World.setEntityState介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

  1. @Override
  2. protected void onImpact(@Nonnull RayTraceResult var1) {
  3. if(!world.isRemote) {
  4. if(var1 != null) {
  5. EnumFacing dir = var1.sideHit;
  6. if(dir != null && dir.getAxis() != EnumFacing.Axis.Y) {
  7. BlockPos pos = var1.getBlockPos().offset(dir);
  8. while(pos.getY() > 0) {
  9. IBlockState state = world.getBlockState(pos);
  10. Block block = state.getBlock();
  11. if(block.isAir(state, world, pos)) {
  12. IBlockState stateSet = ModBlocks.solidVines.getDefaultState().withProperty(propMap.get(dir.getOpposite()), true);
  13. world.setBlockState(pos, stateSet, 1 | 2);
  14. world.playEvent(2001, pos, Block.getStateId(stateSet));
  15. pos = pos.down();
  16. } else break;
  17. }
  18. }
  19. }
  20. this.world.setEntityState(this, (byte)3);
  21. setDead();
  22. }
  23. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public void setEntityState(@Nonnull Entity entityIn, byte state) {
  3. wrapped.setEntityState(entityIn, state);
  4. }

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public void setEntityState(Entity entityIn, byte state) {
  3. getActualWorld().setEntityState(entityIn, state);
  4. }

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

  1. @Override
  2. public boolean processInteract(EntityPlayer player, EnumHand hand) {
  3. if (getOwnerId() != null) {
  4. if (!world.isRemote) {
  5. setOwnerId(player.getUniqueID());
  6. this.world.setEntityState(this, (byte) 7);
  7. } else {
  8. this.world.setEntityState(this, (byte) 6);
  9. }
  10. return true;
  11. }
  12. return false;
  13. }

代码示例来源:origin: WayofTime/BloodMagic

  1. /**
  2. * Execute a one shot task or start executing a continuous task
  3. */
  4. @Override
  5. public void startExecuting() {
  6. this.castTimer = 100;
  7. this.world.setEntityState(this.entity, (byte) 53);
  8. this.entity.getNavigator().clearPath();
  9. }

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

  1. private void setOpeningStatus(byte op) {
  2. this.gateStatus = op;
  3. if (!this.world.isRemote) {
  4. this.world.setEntityState(this, op);
  5. }
  6. if (op == -1) {
  7. this.gateType.onGateStartClose(this);
  8. } else if (op == 1) {
  9. this.gateType.onGateStartOpen(this);
  10. }
  11. }

代码示例来源:origin: WayofTime/BloodMagic

  1. /**
  2. * Execute a one shot task or start executing a continuous task
  3. */
  4. public void startExecuting() {
  5. this.eatingGrassTimer = 40;
  6. this.world.setEntityState(this.grassEaterEntity, (byte) 10);
  7. this.grassEaterEntity.getNavigator().clearPath();
  8. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. private void setBuff() {
  2. world.setEntityState(this, (byte) 7);
  3. addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
  4. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. private void setBuff() {
  2. world.setEntityState(this, (byte) 7);
  3. addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
  4. }

代码示例来源:origin: Vazkii/Botania

  1. @Override
  2. public void onUpdate() {
  3. super.onUpdate();
  4. if(!supertile.getWorld().isRemote) {
  5. int manaCost = 12;
  6. List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
  7. List<EntityAnimal> animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
  8. int slowdown = getSlowdownFactor();
  9. for(EntityAnimal animal : animals) {
  10. if(mana < manaCost)
  11. break;
  12. if(animal.getGrowingAge() == 0 && !animal.isInLove()) {
  13. for(EntityItem item : items) {
  14. if(item.age < 60 + slowdown || item.isDead)
  15. continue;
  16. ItemStack stack = item.getItem();
  17. if(!stack.isEmpty() && animal.isBreedingItem(stack)) {
  18. stack.shrink(1);
  19. mana -= manaCost;
  20. animal.inLove = 1200;
  21. supertile.getWorld().setEntityState(animal, (byte)18);
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. @Override
  2. public boolean attackEntityAsMob(Entity entityIn) {
  3. attackTimer = 10;
  4. world.setEntityState(this, (byte) 4);
  5. boolean var2 = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float) 7 + rand.nextInt(15));
  6. if (var2) {
  7. entityIn.motionY += 0.2D;
  8. }
  9. playSound(SoundEvents.ENTITY_IRONGOLEM_ATTACK, 1.0F, 1.0F);
  10. return var2;
  11. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. @Override
  2. public boolean attackEntityAsMob(Entity entityIn) {
  3. attackTimer = 10;
  4. world.setEntityState(this, (byte) 4);
  5. boolean var2 = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 7F + rand.nextInt(15));
  6. if (var2) {
  7. entityIn.motionY += 0.6000000059604645D;
  8. }
  9. playSound(SoundEvents.ENTITY_IRONGOLEM_ATTACK, 1.0F, 1.0F);
  10. return var2;
  11. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. @Override
  2. public boolean attackEntityFrom(DamageSource source, float damage) {
  3. Entity entity = source.getImmediateSource();
  4. if (entity instanceof EntityArrow) {
  5. world.setEntityState(this, (byte) 8);
  6. heal(EntityAttributes.MAX_HEALTH_2 * 0.10F);
  7. }
  8. return super.attackEntityFrom(source, Math.min(damage, EntityAttributes.BASE_DEFENSE_2));
  9. }

代码示例来源:origin: vadis365/TheErebus

  1. public void setIsBoss(byte boss) {
  2. dataManager.set(IS_BOSS, Byte.valueOf(boss));
  3. getEntityWorld().setEntityState(this, (byte) 25);
  4. if (areAttributesSetup)
  5. updateBossAttributes();
  6. }

代码示例来源:origin: vadis365/TheErebus

  1. @Override
  2. protected void jump() {
  3. super.jump();
  4. double moveSpeed = moveHelper.getSpeed();
  5. if (moveSpeed > 0.0D) {
  6. double moveSpeedSq = motionX * motionX + motionZ * motionZ;
  7. if (moveSpeedSq < 0.010000000000000002D)
  8. moveRelative(0.0F, 0.0F, 1.0F, 0.1F);
  9. }
  10. if (!world.isRemote)
  11. world.setEntityState(this, (byte) 1);
  12. }

代码示例来源:origin: ata4/dragon-mounts

  1. public void tamedFor(EntityPlayer player, boolean successful) {
  2. if (successful) {
  3. setTamed(true);
  4. navigator.clearPathEntity(); // replacement for setPathToEntity(null);
  5. setAttackTarget(null);
  6. setOwnerId(player.getUniqueID());
  7. playTameEffect(true);
  8. worldObj.setEntityState(this, (byte) 7);
  9. } else {
  10. playTameEffect(false);
  11. worldObj.setEntityState(this, (byte) 6);
  12. }
  13. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. private void setBuff() {
  2. world.setEntityState(this, (byte) 7);
  3. addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
  4. addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 20 * 60, 0));
  5. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. private void setBuff() {
  2. world.setEntityState(this, (byte) 7);
  3. addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
  4. addPotionEffect(new PotionEffect(MobEffects.HASTE, 20 * 60, 0));
  5. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. private void setBuff() {
  2. world.setEntityState(this, (byte) 7);
  3. addPotionEffect(new PotionEffect(MobEffects.SPEED, 20 * 60, 0));
  4. addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20 * 60, 0));
  5. }

代码示例来源:origin: Silentine/GrimoireOfGaia

  1. @Override
  2. public void onLivingUpdate() {
  3. beaconDebuff(4, MobEffects.SLOWNESS, 100, 1);
  4. if (getHealth() < EntityAttributes.MAX_HEALTH_2) {
  5. if (hasItem()) {
  6. setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.EMPTY);
  7. world.setEntityState(this, (byte) 8);
  8. heal(EntityAttributes.MAX_HEALTH_2 * 0.20F);
  9. }
  10. }
  11. super.onLivingUpdate();
  12. }

相关文章

World类方法