Advertisement
ViiRuS

Minecraft Mob Programming Code

Nov 6th, 2011
5,387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.16 KB | None | 0 0
  1. //Mod_ File Code-----------------------------------------------------------
  2.  
  3. //Renderer Code (Mod_ File)
  4. public void AddRenderer(Map map)    
  5. {          
  6.  map.put(EntityFlyingSpiderPig.class, new RenderFlyingSpiderPig(new ModelFlyingSpiderPig(), 0.5F));
  7. }
  8.  
  9. //Other Stuff (Mod_ File)
  10. ModLoader.RegisterEntityID(EntityFlyingSpiderPig.class, "Flying Spider Pig",
  11.  
  12. ModLoader.getUniqueEntityId());                      
  13.    
  14. ModLoader.AddSpawn(EntityFlyingSpiderPig.class, 12, 4, 4, EnumCreatureType.creature);
  15.  
  16. //Render File--------------------------------------------------------------
  17.  
  18. //To render a name at the top of a Mob's Head
  19.  
  20. renderLivingLabel(entity, entity.Name, d, d1, d2, 64);
  21.  
  22. //The Whole Render File
  23. package net.minecraft.src;
  24.  
  25. public class RenderFlyingSpiderPig extends RenderLiving
  26. {
  27.  
  28.     public RenderFlyingSpiderPig(ModelBase modelbase, float f)
  29.     {
  30.         super(modelbase, f);
  31.     }
  32.  
  33.     public void func_177_a(EntityFlyingSpiderPig entity, double d, double d1, double d2,
  34.             float f, float f1)
  35.     {
  36.         super.doRenderLiving(entity, d, d1, d2, f, f1);
  37.     }
  38.  
  39.     public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2,
  40.             float f, float f1)
  41.     {
  42.         func_177_a((EntityFlyingSpiderPig)entityliving, d, d1, d2, f, f1);
  43.     }
  44.  
  45.     public void doRender(Entity entity, double d, double d1, double d2,
  46.             float f, float f1)
  47.     {
  48.         func_177_a((EntityFlyingSpiderPig)entity, d, d1, d2, f, f1);
  49.     }
  50. }
  51.  
  52.  
  53. //Entity File--------------------------------------------------------------
  54.  
  55. //This is where you initialize/declare the name
  56.  
  57. Name = "Flying Spider Pig";
  58.  
  59. //Spawner Block File-------------------------------------------------------
  60.  
  61. public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)    
  62.     {        
  63.     EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("Something", entityplayer.worldObj);        
  64.     entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F); //x, y, z, yaw, pitch        
  65.     entityplayer.worldObj.entityJoinedWorld(entityliving);    
  66.     }
  67.  
  68. //--------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement