Jump to content

Help with porting entities from 1.15.2 to 1.17.1


Jeremy Quann

Recommended Posts

I need some help from you guys out there to get this code a fixer-upper:

package tld.sullysmod.modid.entity;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.function.BiFunction;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.model.Model;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.entity.CreatureAttribute;
import net.minecraft.entity.CreatureEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntitySpawnPlacementRegistry;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.controller.FlyingMovementController;
import net.minecraft.entity.ai.controller.MovementController;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.ai.goal.HurtByTargetGoal;
import net.minecraft.entity.ai.goal.LookRandomlyGoal;
import net.minecraft.entity.ai.goal.RandomWalkingGoal;
import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.SpawnEggItem;
import net.minecraft.network.IPacket;
import net.minecraft.pathfinding.FlyingPathNavigator;
import net.minecraft.pathfinding.PathNavigator;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.Heightmap;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.common.DungeonHooks;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.network.FMLPlayMessages;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistryEntry;
import tld.sullysmod.modid.SullysModModElements;
import tld.sullysmod.modid.SullysModModElements.ModElement.Tag;
import tld.sullysmod.modid.procedures.BabyWitherPlayerCollidesWithThisEntityProcedure;

@Tag
public class BabyWitherEntity extends SullysModModElements.ModElement {
  public static EntityType entity = null;
  
  public BabyWitherEntity(SullysModModElements instance) {
    super(instance, 2);
    FMLJavaModLoadingContext.get().getModEventBus().register(this);
  }
  
  public void initElements() {
    entity = (EntityType)EntityType.Builder.func_220322_a(CustomEntity::new, EntityClassification.MONSTER).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).func_220320_c().func_220321_a(0.6F, 1.8F).func_206830_a("witherling").setRegistryName("witherling");
    this.elements.entities.add(() -> entity);
    this.elements.items
      .add(() -> (Item)(new SpawnEggItem(entity, -13355980, -5921371, (new Item.Properties()).func_200916_a(ItemGroup.field_78026_f))).setRegistryName("witherling"));
  }
  
  public void init(FMLCommonSetupEvent event) {
    for (Biome biome : ForgeRegistries.BIOMES.getValues()) {
      boolean biomeCriteria = false;
      if (ForgeRegistries.BIOMES.getKey((IForgeRegistryEntry)biome).equals(new ResourceLocation("nether")))
        biomeCriteria = true; 
      if (!biomeCriteria)
        continue; 
      biome.func_76747_a(EntityClassification.MONSTER).add(new Biome.SpawnListEntry(entity, 3, 1, 2));
    } 
    EntitySpawnPlacementRegistry.func_209343_a(entity, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::func_223324_d);
    DungeonHooks.addDungeonMob(entity, 180);
  }
  
  @SubscribeEvent
  @OnlyIn(Dist.CLIENT)
  public void registerModels(ModelRegistryEvent event) {
    RenderingRegistry.registerEntityRenderingHandler(entity, renderManager -> new MobRenderer(renderManager, new ModelMiniWither(), 0.2F) {
          public ResourceLocation func_110775_a(Entity entity) {
            return new ResourceLocation("sullys_mod:textures/miniwithernormalstate.png");
          }
        });
  }
  
  public static class CustomEntity extends MonsterEntity {
    public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) {
      this(BabyWitherEntity.entity, world);
    }
    
    public CustomEntity(EntityType<CustomEntity> type, World world) {
      super(type, world);
      this.field_70728_aV = 0;
      func_94061_f(false);
      this.field_70765_h = (MovementController)new FlyingMovementController((MobEntity)this, 10, true);
      this.field_70699_by = (PathNavigator)new FlyingPathNavigator((MobEntity)this, this.field_70170_p);
    }
    
    public IPacket<?> func_213297_N() {
      return NetworkHooks.getEntitySpawningPacket((Entity)this);
    }
    
    protected void func_184651_r() {
      super.func_184651_r();
      this.field_70714_bg.func_75776_a(1, new Goal() {
            public boolean func_75250_a() {
              if (BabyWitherEntity.CustomEntity.this.func_70638_az() != null && !BabyWitherEntity.CustomEntity.this.func_70605_aq().func_75640_a())
                return true; 
              return false;
            }
            
            public boolean func_75253_b() {
              return (BabyWitherEntity.CustomEntity.this.func_70605_aq().func_75640_a() && BabyWitherEntity.CustomEntity.this.func_70638_az() != null && BabyWitherEntity.CustomEntity.this
                .func_70638_az().func_70089_S());
            }
            
            public void func_75249_e() {
              LivingEntity livingentity = BabyWitherEntity.CustomEntity.this.func_70638_az();
              Vec3d vec3d = livingentity.func_174824_e(1.0F);
              BabyWitherEntity.CustomEntity.this.field_70765_h.func_75642_a(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 1.0D);
            }
            
            public void func_75246_d() {
              LivingEntity livingentity = BabyWitherEntity.CustomEntity.this.func_70638_az();
              if (BabyWitherEntity.CustomEntity.this.func_174813_aQ().func_72326_a(livingentity.func_174813_aQ())) {
                BabyWitherEntity.CustomEntity.this.func_70652_k((Entity)livingentity);
              } else {
                double d0 = BabyWitherEntity.CustomEntity.this.func_70068_e((Entity)livingentity);
                if (d0 < 16.0D) {
                  Vec3d vec3d = livingentity.func_174824_e(1.0F);
                  BabyWitherEntity.CustomEntity.this.field_70765_h.func_75642_a(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 1.0D);
                } 
              } 
            }
          });
      this.field_70715_bh.func_75776_a(2, (Goal)(new HurtByTargetGoal((CreatureEntity)this, new Class[0])).func_220794_a(new Class[] { getClass() }));
      this.field_70714_bg.func_75776_a(3, (Goal)new RandomWalkingGoal((CreatureEntity)this, 0.8D, 20) {
            protected Vec3d func_190864_f() {
              Random random = BabyWitherEntity.CustomEntity.this.func_70681_au();
              double dir_x = BabyWitherEntity.CustomEntity.this.func_226277_ct_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              double dir_y = BabyWitherEntity.CustomEntity.this.func_226278_cu_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              double dir_z = BabyWitherEntity.CustomEntity.this.func_226281_cx_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              return new Vec3d(dir_x, dir_y, dir_z);
            }
          });
      this.field_70714_bg.func_75776_a(4, (Goal)new WaterAvoidingRandomWalkingGoal((CreatureEntity)this, 0.8D));
      this.field_70714_bg.func_75776_a(5, (Goal)new LookRandomlyGoal((MobEntity)this));
    }
    
    public CreatureAttribute func_70668_bt() {
      return CreatureAttribute.field_223223_b_;
    }
    
    protected void func_213333_a(DamageSource source, int looting, boolean recentlyHitIn) {
      super.func_213333_a(source, looting, recentlyHitIn);
      func_199701_a_(new ItemStack((IItemProvider)Items.field_196183_dw, 1));
    }
    
    public SoundEvent func_184601_bQ(DamageSource ds) {
      return (SoundEvent)ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("sullys_mod:babywitherhurt"));
    }
    
    public SoundEvent func_184615_bR() {
      return (SoundEvent)ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("sullys_mod:babywitherdeath"));
    }
    
    public boolean func_225503_b_(float l, float d) {
      return false;
    }
    
    public boolean func_70097_a(DamageSource source, float amount) {
      if (source == DamageSource.field_76379_h)
        return false; 
      if (source == DamageSource.field_76369_e)
        return false; 
      return super.func_70097_a(source, amount);
    }
    
    public void func_70100_b_(PlayerEntity sourceentity) {
      super.func_70100_b_(sourceentity);
      CustomEntity customEntity = this;
      double x = func_226277_ct_();
      double y = func_226278_cu_();
      double z = func_226281_cx_();
      Map<String, Object> $_dependencies = new HashMap<>();
      $_dependencies.put("entity", customEntity);
      $_dependencies.put("x", Double.valueOf(x));
      $_dependencies.put("y", Double.valueOf(y));
      $_dependencies.put("z", Double.valueOf(z));
      $_dependencies.put("world", this.field_70170_p);
      BabyWitherPlayerCollidesWithThisEntityProcedure.executeProcedure($_dependencies);
    }
    
    protected void func_110147_ax() {
      super.func_110147_ax();
      if (func_110148_a(SharedMonsterAttributes.field_111263_d) != null)
        func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.3D); 
      if (func_110148_a(SharedMonsterAttributes.field_111267_a) != null)
        func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(20.0D); 
      if (func_110148_a(SharedMonsterAttributes.field_188791_g) != null)
        func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(0.0D); 
      if (func_110148_a(SharedMonsterAttributes.field_111264_e) == null)
        func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111264_e); 
      func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D);
      if (func_110148_a(SharedMonsterAttributes.field_193334_e) == null)
        func_110140_aT().func_111150_b(SharedMonsterAttributes.field_193334_e); 
      func_110148_a(SharedMonsterAttributes.field_193334_e).func_111128_a(0.3D);
    }
    
    protected void func_184231_a(double y, boolean onGroundIn, BlockState state, BlockPos pos) {}
    
    public void func_189654_d(boolean ignored) {
      super.func_189654_d(true);
    }
    
    public void func_70636_d() {
      super.func_70636_d();
      func_189654_d(true);
    }
  }
  
  public static class ModelMiniWither extends EntityModel<Entity> {
    private final ModelRenderer Head;
    
    private final ModelRenderer bone3;
    
    private final ModelRenderer Body;
    
    private final ModelRenderer bone;
    
    private final ModelRenderer bone2;
    
    public ModelMiniWither() {
      this.field_78090_t = 44;
      this.field_78089_u = 20;
      this.Head = new ModelRenderer((Model)this);
      this.Head.func_78793_a(-1.0F, 12.0F, 1.0F);
      setRotationAngle(this.Head, 0.0F, 0.0F, -0.0873F);
      this.Head.func_78784_a(0, 0).func_228303_a_(-3.0535F, -5.8714F, -4.0F, 6.0F, 6.0F, 6.0F, 0.0F, false);
      this.bone3 = new ModelRenderer((Model)this);
      this.bone3.func_78793_a(1.9503F, -0.9585F, 1.0F);
      this.Head.func_78792_a(this.bone3);
      setRotationAngle(this.bone3, 0.0F, -0.1745F, 0.1745F);
      this.bone3.func_78784_a(24, 0).func_228303_a_(-0.4524F, -2.8083F, -3.9892F, 5.0F, 5.0F, 5.0F, 0.0F, false);
      this.Body = new ModelRenderer((Model)this);
      this.Body.func_78793_a(0.0F, 13.0F, 0.0F);
      setRotationAngle(this.Body, 0.1745F, 0.0F, 0.0F);
      this.Body.func_78784_a(0, 12).func_228303_a_(-1.0F, -0.8112F, 0.1585F, 2.0F, 6.0F, 2.0F, 0.0F, false);
      this.bone = new ModelRenderer((Model)this);
      this.bone.func_78793_a(0.0F, 0.0F, 0.0F);
      this.Body.func_78792_a(this.bone);
      setRotationAngle(this.bone, 0.4363F, 0.0F, 0.0F);
      this.bone.func_78784_a(8, 12).func_228303_a_(-1.0F, 4.847F, -1.804F, 2.0F, 4.0F, 2.0F, 0.0F, false);
      this.bone2 = new ModelRenderer((Model)this);
      this.bone2.func_78793_a(0.0F, 0.0152F, 0.1736F);
      this.Body.func_78792_a(this.bone2);
      setRotationAngle(this.bone2, 0.1745F, 0.0F, 0.0F);
      this.bone2.func_78784_a(14, 16).func_228303_a_(-3.0F, 0.9544F, -0.5209F, 6.0F, 2.0F, 2.0F, 0.0F, false);
      this.bone2.func_78784_a(14, 16).func_228303_a_(-3.0F, 5.241F, 0.7541F, 6.0F, 2.0F, 2.0F, 0.0F, false);
    }
    
    public void func_225598_a_(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
      this.Head.func_228308_a_(matrixStack, buffer, packedLight, packedOverlay);
      this.Body.func_228308_a_(matrixStack, buffer, packedLight, packedOverlay);
    }
    
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
      modelRenderer.field_78795_f = x;
      modelRenderer.field_78796_g = y;
      modelRenderer.field_78808_h = z;
    }
    
    public void func_225597_a_(Entity e, float f, float f1, float f2, float f3, float f4) {}
  }
}

 

package tld.sullysmod.modid.entity;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import java.util.EnumSet;
import java.util.Random;
import java.util.function.BiFunction;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.model.Model;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.entity.CreatureAttribute;
import net.minecraft.entity.CreatureEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.controller.FlyingMovementController;
import net.minecraft.entity.ai.controller.MovementController;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.ai.goal.HurtByTargetGoal;
import net.minecraft.entity.ai.goal.LookRandomlyGoal;
import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
import net.minecraft.entity.ai.goal.RandomWalkingGoal;
import net.minecraft.entity.ai.goal.RangedAttackGoal;
import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.AmbientEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.network.IPacket;
import net.minecraft.pathfinding.FlyingPathNavigator;
import net.minecraft.pathfinding.PathNavigator;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.network.FMLPlayMessages;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.registries.ForgeRegistries;
import tld.sullysmod.modid.SullysModModElements;
import tld.sullysmod.modid.SullysModModElements.ModElement.Tag;
import tld.sullysmod.modid.item.TinywitherItem;

@Tag
public class AngryWitherEntity extends SullysModModElements.ModElement {
  public static EntityType entity = null;
  
  public AngryWitherEntity(SullysModModElements instance) {
    super(instance, 7);
    FMLJavaModLoadingContext.get().getModEventBus().register(this);
  }
  
  public void initElements() {
    entity = (EntityType)EntityType.Builder.func_220322_a(CustomEntity::new, EntityClassification.MONSTER).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).func_220320_c().func_220321_a(0.6F, 1.8F).func_206830_a("angry_witherling").setRegistryName("angry_witherling");
    this.elements.entities.add(() -> entity);
  }
  
  @SubscribeEvent
  @OnlyIn(Dist.CLIENT)
  public void registerModels(ModelRegistryEvent event) {
    RenderingRegistry.registerEntityRenderingHandler(entity, renderManager -> new MobRenderer(renderManager, new ModelMiniWither(), 0.5F) {
          public ResourceLocation func_110775_a(Entity entity) {
            return new ResourceLocation("sullys_mod:textures/miniwitherdefencestate.png");
          }
        });
  }
  
  public static class CustomEntity extends MonsterEntity implements IRangedAttackMob {
    public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) {
      this(AngryWitherEntity.entity, world);
    }
    
    public CustomEntity(EntityType<CustomEntity> type, World world) {
      super(type, world);
      this.field_70728_aV = 6;
      func_94061_f(false);
      func_110163_bv();
      this.field_70765_h = (MovementController)new FlyingMovementController((MobEntity)this, 10, true);
      this.field_70699_by = (PathNavigator)new FlyingPathNavigator((MobEntity)this, this.field_70170_p);
    }
    
    public IPacket<?> func_213297_N() {
      return NetworkHooks.getEntitySpawningPacket((Entity)this);
    }
    
    protected void func_184651_r() {
      super.func_184651_r();
      this.field_70715_bh.func_75776_a(1, (Goal)new NearestAttackableTargetGoal((MobEntity)this, PlayerEntity.class, false, false));
      this.field_70715_bh.func_75776_a(2, (Goal)new NearestAttackableTargetGoal((MobEntity)this, AmbientEntity.class, false, false));
      this.field_70715_bh.func_75776_a(3, (Goal)new NearestAttackableTargetGoal((MobEntity)this, AnimalEntity.class, false, false));
      this.field_70714_bg.func_75776_a(4, new Goal() {
            public boolean func_75250_a() {
              if (AngryWitherEntity.CustomEntity.this.func_70638_az() != null && !AngryWitherEntity.CustomEntity.this.func_70605_aq().func_75640_a())
                return true; 
              return false;
            }
            
            public boolean func_75253_b() {
              return (AngryWitherEntity.CustomEntity.this.func_70605_aq().func_75640_a() && AngryWitherEntity.CustomEntity.this.func_70638_az() != null && AngryWitherEntity.CustomEntity.this
                .func_70638_az().func_70089_S());
            }
            
            public void func_75249_e() {
              LivingEntity livingentity = AngryWitherEntity.CustomEntity.this.func_70638_az();
              Vec3d vec3d = livingentity.func_174824_e(1.0F);
              AngryWitherEntity.CustomEntity.this.field_70765_h.func_75642_a(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 1.0D);
            }
            
            public void func_75246_d() {
              LivingEntity livingentity = AngryWitherEntity.CustomEntity.this.func_70638_az();
              if (AngryWitherEntity.CustomEntity.this.func_174813_aQ().func_72326_a(livingentity.func_174813_aQ())) {
                AngryWitherEntity.CustomEntity.this.func_70652_k((Entity)livingentity);
              } else {
                double d0 = AngryWitherEntity.CustomEntity.this.func_70068_e((Entity)livingentity);
                if (d0 < 16.0D) {
                  Vec3d vec3d = livingentity.func_174824_e(1.0F);
                  AngryWitherEntity.CustomEntity.this.field_70765_h.func_75642_a(vec3d.field_72450_a, vec3d.field_72448_b, vec3d.field_72449_c, 1.0D);
                } 
              } 
            }
          });
      this.field_70715_bh.func_75776_a(5, (Goal)(new HurtByTargetGoal((CreatureEntity)this, new Class[0])).func_220794_a(new Class[] { getClass() }));
      this.field_70714_bg.func_75776_a(6, (Goal)new RandomWalkingGoal((CreatureEntity)this, 0.7D, 20) {
            protected Vec3d func_190864_f() {
              Random random = AngryWitherEntity.CustomEntity.this.func_70681_au();
              double dir_x = AngryWitherEntity.CustomEntity.this.func_226277_ct_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              double dir_y = AngryWitherEntity.CustomEntity.this.func_226278_cu_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              double dir_z = AngryWitherEntity.CustomEntity.this.func_226281_cx_() + ((random.nextFloat() * 2.0F - 1.0F) * 16.0F);
              return new Vec3d(dir_x, dir_y, dir_z);
            }
          });
      this.field_70714_bg.func_75776_a(7, (Goal)new WaterAvoidingRandomWalkingGoal((CreatureEntity)this, 1.0D));
      this.field_70714_bg.func_75776_a(8, (Goal)new LookRandomlyGoal((MobEntity)this));
      this.field_70714_bg.func_75776_a(1, (Goal)new RangedAttackGoal(this, 1.25D, 20, 10.0F) {
            public boolean func_75253_b() {
              return func_75250_a();
            }
          });
    }
    
    public CreatureAttribute func_70668_bt() {
      return CreatureAttribute.field_223223_b_;
    }
    
    public boolean func_213397_c(double distanceToClosestPlayer) {
      return false;
    }
    
    protected void func_213333_a(DamageSource source, int looting, boolean recentlyHitIn) {
      super.func_213333_a(source, looting, recentlyHitIn);
      func_199701_a_(new ItemStack((IItemProvider)Blocks.field_222388_bz, 1));
    }
    
    public SoundEvent func_184601_bQ(DamageSource ds) {
      return (SoundEvent)ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("sullys_mod:babywitherhurt"));
    }
    
    public SoundEvent func_184615_bR() {
      return (SoundEvent)ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("sullys_mod:babywitherdeath"));
    }
    
    public boolean func_225503_b_(float l, float d) {
      return false;
    }
    
    public boolean func_70097_a(DamageSource source, float amount) {
      if (source == DamageSource.field_76379_h)
        return false; 
      if (source == DamageSource.field_76369_e)
        return false; 
      return super.func_70097_a(source, amount);
    }
    
    protected void func_110147_ax() {
      super.func_110147_ax();
      if (func_110148_a(SharedMonsterAttributes.field_111263_d) != null)
        func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.3D); 
      if (func_110148_a(SharedMonsterAttributes.field_111267_a) != null)
        func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(40.0D); 
      if (func_110148_a(SharedMonsterAttributes.field_188791_g) != null)
        func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(0.0D); 
      if (func_110148_a(SharedMonsterAttributes.field_111264_e) == null)
        func_110140_aT().func_111150_b(SharedMonsterAttributes.field_111264_e); 
      func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D);
      if (func_110148_a(SharedMonsterAttributes.field_193334_e) == null)
        func_110140_aT().func_111150_b(SharedMonsterAttributes.field_193334_e); 
      func_110148_a(SharedMonsterAttributes.field_193334_e).func_111128_a(0.3D);
    }
    
    public void func_82196_d(LivingEntity target, float flval) {
      TinywitherItem.shoot((LivingEntity)this, target);
    }
    
    protected void func_184231_a(double y, boolean onGroundIn, BlockState state, BlockPos pos) {}
    
    public void func_189654_d(boolean ignored) {
      super.func_189654_d(true);
    }
    
    public void func_70636_d() {
      super.func_70636_d();
      func_189654_d(true);
    }
  }
  
  public static class ModelMiniWither extends EntityModel<Entity> {
    private final ModelRenderer Head;
    
    private final ModelRenderer bone3;
    
    private final ModelRenderer Body;
    
    private final ModelRenderer bone;
    
    private final ModelRenderer bone2;
    
    public ModelMiniWither() {
      this.field_78090_t = 44;
      this.field_78089_u = 20;
      this.Head = new ModelRenderer((Model)this);
      this.Head.func_78793_a(-1.0F, 12.0F, 1.0F);
      setRotationAngle(this.Head, 0.0F, 0.0F, -0.0873F);
      this.Head.func_78784_a(0, 0).func_228303_a_(-3.0535F, -5.8714F, -4.0F, 6.0F, 6.0F, 6.0F, 0.0F, false);
      this.bone3 = new ModelRenderer((Model)this);
      this.bone3.func_78793_a(1.9503F, -0.9585F, 1.0F);
      this.Head.func_78792_a(this.bone3);
      setRotationAngle(this.bone3, 0.0F, -0.1745F, 0.1745F);
      this.bone3.func_78784_a(24, 0).func_228303_a_(-0.4524F, -2.8083F, -3.9892F, 5.0F, 5.0F, 5.0F, 0.0F, false);
      this.Body = new ModelRenderer((Model)this);
      this.Body.func_78793_a(0.0F, 13.0F, 0.0F);
      setRotationAngle(this.Body, 0.1745F, 0.0F, 0.0F);
      this.Body.func_78784_a(0, 12).func_228303_a_(-1.0F, -0.8112F, 0.1585F, 2.0F, 6.0F, 2.0F, 0.0F, false);
      this.bone = new ModelRenderer((Model)this);
      this.bone.func_78793_a(0.0F, 0.0F, 0.0F);
      this.Body.func_78792_a(this.bone);
      setRotationAngle(this.bone, 0.4363F, 0.0F, 0.0F);
      this.bone.func_78784_a(8, 12).func_228303_a_(-1.0F, 4.847F, -1.804F, 2.0F, 4.0F, 2.0F, 0.0F, false);
      this.bone2 = new ModelRenderer((Model)this);
      this.bone2.func_78793_a(0.0F, 0.0152F, 0.1736F);
      this.Body.func_78792_a(this.bone2);
      setRotationAngle(this.bone2, 0.1745F, 0.0F, 0.0F);
      this.bone2.func_78784_a(14, 16).func_228303_a_(-3.0F, 0.9544F, -0.5209F, 6.0F, 2.0F, 2.0F, 0.0F, false);
      this.bone2.func_78784_a(14, 16).func_228303_a_(-3.0F, 5.241F, 0.7541F, 6.0F, 2.0F, 2.0F, 0.0F, false);
    }
    
    public void func_225598_a_(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
      this.Head.func_228308_a_(matrixStack, buffer, packedLight, packedOverlay);
      this.Body.func_228308_a_(matrixStack, buffer, packedLight, packedOverlay);
    }
    
    public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
      modelRenderer.field_78795_f = x;
      modelRenderer.field_78796_g = y;
      modelRenderer.field_78808_h = z;
    }
    
    public void func_225597_a_(Entity e, float f, float f1, float f2, float f3, float f4) {}
  }
}

 

package tld.sullysmod.modid.procedures;

import java.util.Map;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ILivingEntityData;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SpawnReason;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import tld.sullysmod.modid.SullysModModElements;
import tld.sullysmod.modid.SullysModModElements.ModElement.Tag;
import tld.sullysmod.modid.entity.AngryWitherEntity;

@Tag
public class BabyWitherPlayerCollidesWithThisEntityProcedure extends SullysModModElements.ModElement {
  public BabyWitherPlayerCollidesWithThisEntityProcedure(SullysModModElements instance) {
    super(instance, 8);
  }
  
  public static void executeProcedure(Map<String, Object> dependencies) {
    if (dependencies.get("entity") == null) {
      System.err.println("Failed to load dependency entity for procedure BabyWitherPlayerCollidesWithThisEntity!");
      return;
    } 
    if (dependencies.get("x") == null) {
      System.err.println("Failed to load dependency x for procedure BabyWitherPlayerCollidesWithThisEntity!");
      return;
    } 
    if (dependencies.get("y") == null) {
      System.err.println("Failed to load dependency y for procedure BabyWitherPlayerCollidesWithThisEntity!");
      return;
    } 
    if (dependencies.get("z") == null) {
      System.err.println("Failed to load dependency z for procedure BabyWitherPlayerCollidesWithThisEntity!");
      return;
    } 
    if (dependencies.get("world") == null) {
      System.err.println("Failed to load dependency world for procedure BabyWitherPlayerCollidesWithThisEntity!");
      return;
    } 
    Entity entity = (Entity)dependencies.get("entity");
    double x = (dependencies.get("x") instanceof Integer) ? ((Integer)dependencies.get("x")).intValue() : ((Double)dependencies.get("x")).doubleValue();
    double y = (dependencies.get("y") instanceof Integer) ? ((Integer)dependencies.get("y")).intValue() : ((Double)dependencies.get("y")).doubleValue();
    double z = (dependencies.get("z") instanceof Integer) ? ((Integer)dependencies.get("z")).intValue() : ((Double)dependencies.get("z")).doubleValue();
    IWorld world = (IWorld)dependencies.get("world");
    if (!entity.field_70170_p.field_72995_K)
      entity.func_70106_y(); 
    if (world instanceof net.minecraft.world.World && !(world.func_201672_e()).field_72995_K) {
      AngryWitherEntity.CustomEntity customEntity = new AngryWitherEntity.CustomEntity(AngryWitherEntity.entity, world.func_201672_e());
      customEntity.func_70012_b(x, y, z, world.func_201674_k().nextFloat() * 360.0F, 0.0F);
      if (customEntity instanceof MobEntity)
        ((MobEntity)customEntity).func_213386_a(world, world.func_175649_E(new BlockPos((Entity)customEntity)), SpawnReason.MOB_SUMMONED, (ILivingEntityData)null, (CompoundNBT)null); 
      world.func_217376_c((Entity)customEntity);
    } 
  }
}

Thanks.

Link to comment
Share on other sites

Oh yeah. Right. I'm making a Witherling and porting it to 1.17.

 

According to Sully's Mod. The description for it says:

Witherlings are rare Nether-mobs that pretty much act like a weaker Wither that can't shoot as far and doesn't do much damage, they drop Wither Rozes when they die.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • 인터넷 K2 단톡방◎BCGAME88·COM♬ 보츠와나 K2 토너먼트 인터넷 지부티 K2 도박장 [본사문의 텔레 JBOX7]인터넷 K2 ▣◈ 본사 세인트키츠 K2 추천 인터넷 나우루 인터넷 K2 바카라펍 [총판문의 카톡 JBOX7]인터넷 K2 ▶♣ 중계 모잠비크 K2 포커대회 인터넷 미얀마 인터넷 K2 포커대회 [각종 오피 커뮤니티 제작]인터넷 K2 ◇〓 경기 캄보디아 K2 게임장 인터넷 앤티가바부다 인터넷 K2 총판 [마케팅문의]인터넷 K2 §¶ 사이트 벨리즈 K2 홀덤펍 인터넷 몰타 인터넷 K2 투어 [카지노본사]인터넷 K2 ♪○ 홀덤바 바하마 K2 리그 인터넷 시에라리온 인터넷 K2 동영상 [스포츠본사]인터넷 K2 ↔◁ 카지노펍 리조트월드카지노 K2 게임장 인터넷 레바논 인터넷 K2 홀덤펍 [토토본사 문의]인터넷 K2 ♭‡ 도박장 모로코 K2 포커대회 인터넷 폭스우드카지노 인터넷 K2 모집 [토토총판 구매]인터넷 K2 △◇ 총판 체코 K2 단톡방 인터넷 모나코 인터넷 K2 게임 [카지노총판]인터넷 K2 ↖▲ 홀덤바 헤르체고비나 K2 사이트 인터넷 세이셸 인터넷 K2 홀덤펍 [야마토본사]인터넷 K2 *@ 홀덤바 벨라루스 K2 방법 인터넷 수리남 인터넷 K2 토너먼트 [바카라총판]인터넷 K2 #♠ 유투브 MGM카지노 K2 놀이터 인터넷 케냐 인터넷 K2 커뮤니티 [경마총판]샌즈카지노 K2 총판 헤르체고비나 K2 방송 [BCGAME 비씨게임 총판문의]알림 설정 추천 구독 좋아요
    • 해외 바카라 바카라펍™BCGAME88·COM▦ 카보베르데 바카라 쿠푼 해외 쿠웨이트 바카라 커뮤니티 [본사문의 텔레 JBOX7]해외 바카라 #☜ 홀덤바 오세아니아 바카라 모집 해외 네덜란드 해외 바카라 쿠푼 [총판문의 카톡 JBOX7]해외 바카라 ☎㏇ 방송 말레이시아 바카라 게임 해외 콩고민주 해외 바카라 게임장 [각종 오피 커뮤니티 제작]해외 바카라 †▶ 놀이터 콩고 바카라 본사 해외 에스토니아 해외 바카라 싸이트 [마케팅문의]해외 바카라 ↔↖ 게임 이라크 바카라 검증 해외 슬로바키아 해외 바카라 싸이트 [카지노본사]해외 바카라 ☆▩ 검증 스페인 바카라 동영상 해외 콩고 해외 바카라 투어 [스포츠본사]해외 바카라 ▩■ 동영상 레소토 바카라 모집 해외 스리랑카 해외 바카라 업체 [토토본사 문의]해외 바카라 ▧◀ 커뮤니티 슬로바키아 바카라 도박장 해외 에리트레아 해외 바카라 게임장 [토토총판 구매]해외 바카라 ▒☜ 쿠푼 샌즈카지노 바카라 사이트 해외 에스토니아 해외 바카라 캐쉬게임 [카지노총판]해외 바카라 ™@ 동영상 BCGAME카지노 바카라 싸이트 해외 트리니다드 해외 바카라 업체 [야마토본사]해외 바카라 ↓▒ 본사 카자흐스탄 바카라 방법 해외 서아프리카 해외 바카라 본사 [바카라총판]해외 바카라 ☏○ 경기 사우디아라비아 바카라 투어 해외 모잠비크 해외 바카라 토너먼트 [경마총판]오세아니아 바카라 총판 나이지리아 바카라 총판 [BCGAME 비씨게임 총판문의]알림 설정 추천 구독 좋아요
    • 동남아 WSOP 캐쉬게임〓BCGAME88·COM▣ 모리셔스 WSOP 캐쉬게임 동남아 타지키스탄 WSOP 추천 [본사문의 텔레 JBOX7]동남아 WSOP ‡● 쿠푼 서아시아 WSOP 투어 동남아 소말릴란드 동남아 WSOP 전략 [총판문의 카톡 JBOX7]동남아 WSOP ♧▩ 캐쉬게임 리오올스위트카지노 WSOP 도박장 동남아 가봉 동남아 WSOP 게임장 [각종 오피 커뮤니티 제작]동남아 WSOP &◀ 추천 한국 WSOP 유투브 동남아 동남아 동남아 WSOP 게임 [마케팅문의]동남아 WSOP ▒□ 투어 라오스 WSOP 본사 동남아 쿠바 동남아 WSOP 투어 [카지노본사]동남아 WSOP ↖▷ 유투브 타지키스탄 WSOP 유투브 동남아 칠레 동남아 WSOP 바카라펍 [스포츠본사]동남아 WSOP &◇ 여행 라트비아 WSOP 주소 동남아 에스와티니 동남아 WSOP 여행 [토토본사 문의]동남아 WSOP ◎☜ 주소 벨기에 WSOP 도박장 동남아 상투메프린시페 동남아 WSOP 싸이트 [토토총판 구매]동남아 WSOP △○ 경기 헝가리 WSOP 주소 동남아 몰디브 동남아 WSOP 포커대회 [카지노총판]동남아 WSOP @■ 싸이트 아리아카지노 WSOP 토너먼트 동남아 소말릴란드 동남아 WSOP 도박장 [야마토본사]동남아 WSOP 〓▣ 유투브 북유럽 WSOP 검증 동남아 감비아 동남아 WSOP 리그 [바카라총판]동남아 WSOP ↗● 방법 바레인 WSOP 여행 동남아 이집트 동남아 WSOP 접속 [경마총판]몬테네그로 WSOP 방법 네덜란드 WSOP 게임 [BCGAME 비씨게임 총판문의]알림 설정 추천 구독 좋아요
    • 카사노바 사이트 ㏂ºBCGAME88ºC0Mº-㈜ 벳캠프 경기 먹튀안내소 벳캠프 토너먼트 웹툰1번지 xf7d8 ▷ 벳캠프 바카라펍 이토랜드 벳캠프 방송 밍키넷 do9u2 ♪ 벳캠프 업체 밤의달리기 벳캠프 커뮤니티 오나왕 qj7e3 ♪ 벳캠프 여행 커뮤니티 벳캠프 총판 토렌트와이 kc7r7 ♨ 벳캠프 싸이트 야동뱅크 벳캠프 영상 옥션 kr5n0 ª 벳캠프 총판 보자요 벳캠프 방법 출장다나와 yp3w2 ♧ 벳캠프 포커대회 라스베가스코리아 벳캠프 단톡방 카먹 xx8a1 ☏ 벳캠프 유투브 봉봉몰 벳캠프 총판 토토왕국 ba2u4 ↖ 벳캠프 놀이터 한국일보 벳캠프 전략 벳모아 nv3j9 @ 벳캠프 전략 먹튀빅리그 벳캠프 리그 토이버 wr8s0 ☎ 벳캠프 투어 오피놀자 벳캠프 주소 토캅스 ju8l8 ☆ 벳캠프 도박장 팬티하우스 벳캠프 방법 인부의밤 dy8x9 ↓ 벳캠프 바카라펍 전라도달리기 벳캠프 검증 레드문 id3c0 ↗ 벳캠프 중계 먹튀쇼미 벳캠프 방법 토토베이 ko1v8 ㈜ 벳캠프 유투브 펜사람닷컴 벳캠프 여행 온카판 fk0v5 △
    • 사랑가득한밤 모집 ▧ºBCGAME88ºC0Mº-▲ 토토쿨 본사 호호툰 토토쿨 단톡방 HDTV gc2w1 ♩ 토토쿨 주소 퐁퐁티비 토토쿨 바카라펍 누누티비 sh2p8 ♨ 토토쿨 카지노펍 생활정보 토토쿨 동영상 봉봉몰 bu4p5 & 토토쿨 홀덤바 오피맵 토토쿨 검증 Warhole qm6b9 ※ 토토쿨 추천 토렌트킹 토토쿨 여행 탁탁탁 tj4h7 & 토토쿨 총판 인도웹 토토쿨 놀이터 유흥가 ji7a0 ☏ 토토쿨 여행 망가쇼미 토토쿨 동영상 오피그램 tg2q9 ↑ 토토쿨 전략 헤이코리안 토토쿨 유투브 카사노바 mp6p4 ♣ 토토쿨 투어 펜사람닷컴 토토쿨 중계 핫타이 bn0t3 ■ 토토쿨 경기 온카25 토토쿨 동영상 졸잼 gs9i1 ↔ 토토쿨 포커대회 아이러브밤 토토쿨 방법 터키한인회 cl9a3 ♪ 토토쿨 업체 오피스타 토토쿨 포커대회 TOPDigital cg3q4 ↖ 토토쿨 영상 벌렁이 토토쿨 투어 비윈TV qp8j0 ª 토토쿨 토너먼트 오피가이드 토토쿨 커뮤니티 야파 ul4x6 ▩ 토토쿨 접속 N토토 토토쿨 사이트 다이아티비 wk6d7 ▷
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.