
jewell012
Members-
Posts
33 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
jewell012's Achievements

Tree Puncher (2/8)
0
Reputation
-
There's no need to use a DataWatcher, applyEntityAttributes() is called on both sides. @OP: Add @Override to all of your methods you intend to override, it will tell you something is wrong. You missed the s at the end of your applyEntityAttributes() method. Alright so for the Health, adding the s at the end of applyEntityAttributes actually worked, however, Now the mob is like OP strong, no matter what I set the damage value to it is like a 2 hit kill and the lower I set it ex 9.0D the strong it gets. while even when I set it to 90.0D it does half damage but then anything higher it does higher damage
-
Alright, so the mob is killed with a normal sword after three hits when it is suppose to have 300 health. I copied the health from the wither, either way though 300.0d and 300.0D do nothing to improve its health. protected void applyEntityAttribute(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.45D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(25.0D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); } Heres the entire classfile if you need it package com.phantasyrealms.entity; import com.phantasyrealms.item.PhantasyRealmsItems; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveThroughVillage; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class EntityHildeBearMob extends EntityMob implements IBossDisplayData{ public EntityHildeBearMob(World par1World) { super(par1World); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 0.3D, false)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.45D)); this.tasks.addTask(7, new EntityAIWander(this, 0.4D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.setSize(1.9F, 2.5F); } public boolean isAIEnabled(){ return true; } protected boolean canDespawn() { return false; } protected void applyEntityAttribute(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.45D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(25.0D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); } protected void entityInit() { super.entityInit(); } protected Item getDropItem() { return PhantasyRealmsItems.saber; } /** * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param * par2 - Level of Looting used to kill this mob. */ protected void dropFewItems(boolean par1, int par2) { int dropType = rand.nextInt(40); if(dropType == 1){ this.dropItem(PhantasyRealmsItems.rsaber, 1); } if(dropType == 3){ this.dropItem(PhantasyRealmsItems.scimitar, 1); } if(dropType == 5){ this.dropItem(PhantasyRealmsItems.rsword3, 1); } if(dropType == 7){ this.dropItem(PhantasyRealmsItems.brand2, 1); } if(dropType == 9){ this.dropItem(PhantasyRealmsItems.reHelmet, 1); } if(dropType == 11){ this.dropItem(PhantasyRealmsItems.rePlate, 1); } if(dropType == 13){ this.dropItem(PhantasyRealmsItems.rePants, 1); } if(dropType == 15){ this.dropItem(PhantasyRealmsItems.reBoots, 1); } if(dropType == 17){ this.dropItem(PhantasyRealmsItems.teHelmet, 1); } if(dropType == 19){ this.dropItem(PhantasyRealmsItems.tePlate, 1); } if(dropType == 21){ this.dropItem(PhantasyRealmsItems.tePants, 1); } if(dropType == 23){ this.dropItem(PhantasyRealmsItems.teBoots, 1); } if(dropType == 31){ this.dropItem(PhantasyRealmsItems.rsaber1, 1); } if(dropType == 37){ this.dropItem(PhantasyRealmsItems.baxe1, 1); } if(dropType == 25){ this.dropItem(PhantasyRealmsItems.meseta, 30); } if(dropType == 27){ this.dropItem(PhantasyRealmsItems.meseta, 35); } if(dropType == 29){ this.dropItem(PhantasyRealmsItems.meseta, 40); } } protected void dropRareDrop(int p_70600_1_) { this.entityDropItem(new ItemStack(PhantasyRealmsItems.digrinder, 1, 1), 0.0F); } }
-
Yeah the addChild did it, but I decided not to use the mob anyway thanks for your help though.
-
Alright so I get that, now I dont know what to do about it, In the Techne I positioned the rotation point in the same spot, when I did that with the nose and then set it to the head it worked just fine. and then before I set the rotation point to the same as the head it was the same problem. So should I again adjust the model of it?
-
What do you mean? the setRotation? or the setRotationPoint?
-
Alright, so I have been tinkering with particle effects when a player holds an Item and I have gotten It down, the only part I cant really figure out now is adjusting it to where its on the sword or Item rather than the player. The issue I have had with trying to set it on the Item specifically is when adjusting it gets stuck in a fixed position always either south or east of the player. This is the normal code, It spawns particles around player. Sorry for the format, the code insert isn't working for me @SideOnly(Side.CLIENT) public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer) par3Entity; Random rand = new Random(); if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() == PhantasyRealmsItems.drsabre) { for(int countparticles = 0; countparticles <= 2; ++countparticles) { par2World.spawnParticle("portal", player.posX + (rand.nextDouble() - 0.5D) * (double)player.width, player.posY + rand.nextDouble() * (double)player.height - (double)player.yOffset, player.posZ + (rand.nextDouble() - 0.5D) * (double)player.width, 0.0D, 0.0D, 0.0D); } } }
-
I have been working with custom models for a while now, and Its only until now I have been stumped, I did a lot of Trial and error and worked out part of the issue but some still remain. Anyways, the problem is making the leaves move with the head as a whole, I have got the nose to do it but I just cant get the leaves to do it. package com.phantasyrealms.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelPoisonLilyMob extends ModelBase { //fields ModelRenderer head; ModelRenderer body; ModelRenderer nose; ModelRenderer Leaf1; ModelRenderer Base; ModelRenderer Leaf2; ModelRenderer Leaf3; public ModelPoisonLilyMob() { textureWidth = 64; textureHeight = 32; head = new ModelRenderer(this, 0, 0); head.addBox(-4F, -8F, -7F, 8, 8, ; head.setRotationPoint(0F, -7F, -1F); head.setTextureSize(64, 32); head.mirror = true; setRotation(head, 0F, 0F, 0F); body = new ModelRenderer(this, 56, -1); body.addBox(-1F, 0F, -1F, 2, 30, 2); body.setRotationPoint(0F, -7F, 0F); body.setTextureSize(64, 32); body.mirror = true; setRotation(body, 0F, 0F, 0F); nose = new ModelRenderer(this, 32, 6); nose.addBox(-2F, -6F, -15F, 4, 4, ; nose.setRotationPoint(0F, -7F, -1F); nose.setTextureSize(64, 32); nose.mirror = true; setRotation(nose, 0F, 0F, 0F); Leaf1 = new ModelRenderer(this, 37, 19); Leaf1.addBox(-6F, 6F, -3F, 6, 10, 1); Leaf1.setRotationPoint(0F, -7F, -1F); Leaf1.setTextureSize(64, 32); Leaf1.mirror = true; setRotation(Leaf1, -2.792527F, 0F, 0.9250245F); Base = new ModelRenderer(this, 0, 18); Base.addBox(-6F, -1F, -6F, 12, 2, 12); Base.setRotationPoint(0F, 23F, 0F); Base.setTextureSize(64, 32); Base.mirror = true; setRotation(Base, 0F, 0F, 0F); Leaf2 = new ModelRenderer(this, 37, 19); Leaf2.addBox(0F, 6F, -3F, 6, 10, 1); Leaf2.setRotationPoint(0F, -7F, -1F); Leaf2.setTextureSize(64, 32); Leaf2.mirror = true; setRotation(Leaf2, -2.792527F, 0F, -0.9250245F); Leaf3 = new ModelRenderer(this, 37, 19); Leaf3.addBox(-3F, 0F, -1F, 6, 10, 1); Leaf3.setRotationPoint(0F, -7F, -1F); Leaf3.setTextureSize(64, 32); Leaf3.mirror = true; setRotation(Leaf3, -0.418879F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); head.render(f5); body.render(f5); nose.render(f5); Leaf1.render(f5); Base.render(f5); Leaf2.render(f5); Leaf3.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { float f6 = (180F / (float)Math.PI); this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); this.nose.rotateAngleX = this.head.rotateAngleX; this.nose.rotateAngleY = this.head.rotateAngleY; this.Leaf1.rotateAngleX = this.head.rotateAngleX; this.Leaf1.rotateAngleY = this.head.rotateAngleY; this.Leaf2.rotateAngleX = this.head.rotateAngleX; this.Leaf2.rotateAngleY = this.head.rotateAngleY; this.Leaf3.rotateAngleX = this.head.rotateAngleX; this.Leaf3.rotateAngleY = this.head.rotateAngleY; } } It is suppose to look like this https://docs.google.com/document/d/1Wo2BtzfXjKHsbRPiAQ39DxPQb8CrX1B2ZLE-ux9HbaU/edit Instead it looks like this https://docs.google.com/document/d/19T9rCgbAHni5z14ugwJIGupIXKxa5ojlTmVfhvs1ymQ/edit
-
How would I do this, I have never touched NBT methods and usage before.
-
So basically, the mob is spawned in by onRightClick in the ItemMag.class, it is suppose to follow the player and be like directly behind the player and by its shoulder at all times but problem 1. Dont know how to set position for it, it usually stays up high, because I modeled it in the Ideal location so really its just a matter of keeping close behind the player. problem 2. the Mob wont follow the player at all, I think its the ItemMag.class error. problem 3. is onLeftClick doesnt despawn the mob, when it should. I want a player to only be able to spawn 1 of the entity. Here are my classes. ItemMag.class package com.phantasyrealms.item; import com.phantasyrealms.entity.EntityMag; import com.phantasyrealms.lib.Strings; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; public class ItemMag extends Item{ EntityMag par1; public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){ if(par1 == null){ par1 = new EntityMag(world); par1.setPosition(player.posX, player.posY+1,player.posZ-2); par1.func_152115_b(player.getUniqueID().toString()); world.spawnEntityInWorld(par1); player.inventory.addItemStackToInventory(new ItemStack(PhantasyRealmsItems.mag)); --itemstack.stackSize; } else{ player.addChatComponentMessage(new ChatComponentTranslation ("Already Have one!")); } return null; } public ItemStack onItemLeftClick(ItemStack itemstack, World world, EntityPlayer player){ par1.func_152115_b(player.getUniqueID().toString()); world.removeEntity(par1); player.addChatComponentMessage(new ChatComponentTranslation ("RETURN!")); player.inventory.addItemStackToInventory(new ItemStack(PhantasyRealmsItems.mag)); return null; } } EntityMag.class package com.phantasyrealms.entity; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIBeg; import net.minecraft.entity.ai.EntityAIFollowOwner; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILeapAtTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAITargetNonTamed; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; public class EntityMag extends EntityTameable { public EntityMag(World world) { super(world); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(9, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); this.setSize(0.9F, 0.9F); } protected void applyEntityAttributes(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); } public boolean attackEntityAsMob(Entity par1Entity) { int i = 5; return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), 5.0F); } protected boolean isAIEnabled() { return true; } public void onDeath(DamageSource par1DamageSource) { super.onDeath(par1DamageSource); } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEFINED; } public boolean interact(EntityPlayer par1EntityPlayer){ this.func_152115_b(par1EntityPlayer.getUniqueID().toString()); return true; } protected boolean canDespawn() { return false; } protected void dropFewItems(boolean par1, int par2) { } public EntityAgeable createChild(EntityAgeable entityageable) { return null; } }
-
Designating HotBar slot as CustomArmor slot
jewell012 replied to jewell012's topic in Modder Support
Perfect Thank you -
Designating HotBar slot as CustomArmor slot
jewell012 replied to jewell012's topic in Modder Support
Hmm alright, I thought it wouldve just been easier to use an existing one. Thanks for the help though! -
Designating HotBar slot as CustomArmor slot
jewell012 replied to jewell012's topic in Modder Support
No I mean like designate the hot bar slot to the far right, number 9, as a armor slot, except you can only put a Item or Armor of a specific type in that slot. An example would be a type being a Ring, so only a Ring Typed Item would be able to be in Hotbar slot 9. -
I am just curious as to how one would go about doing this. Would it be as simple as just creating a method that sets a slot number as the Armor slot?
-
Error AL lib: (EE) alc_cleanup: 1 device not closed
jewell012 replied to jewell012's topic in Modder Support
Will you take a look at my KeyHandler code, and MainRegistry, the game runs fine now after initializing however the GUI doesn't pop up on button press, the button doesnt even show on the controls menu -
Error AL lib: (EE) alc_cleanup: 1 device not closed
jewell012 replied to jewell012's topic in Modder Support
I changed it but still a crash, am I not initializing it right? MainRegistry package com.phantasyrealms.main; import java.io.File; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import sun.net.NetworkServer; import sun.security.krb5.Config; import net.minecraftforge.common.MinecraftForge; import com.phantasyrealms.entity.EntityBoomaMob; import com.phantasyrealms.entity.PhantasyRealmsEntity; import com.phantasyrealms.eventhandler.EventHandlerEntity; import com.phantasyrealms.eventhandler.EventHandlerNetwork; import com.phantasyrealms.item.PhantasyRealmsItems; import com.phantasyrealms.lib.Strings; import com.phantasyrealms.packethandling.PacketHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; @Mod(modid = Strings.MODID, name = Strings.name, version = Strings.version) public class MainRegistry { public static final int GUI = 0; @SidedProxy(clientSide = "com.phantasyrealms.main.ClientProxy", serverSide = "com.phantasyrealms.main.ServerProxy") public static ServerProxy proxy; @Instance(Strings.MODID) public static MainRegistry modInstance; public static Object instance; public static File modDir; public static EventHandlerEntity entityEventHandler; public static EventHandlerNetwork entityEventNetwork; public static ServerProxy GuiHandler; public class RegisterKeyBindings { } /** * Loads before * @param PostEvent */ @EventHandler public static void PreLoad(FMLPreInitializationEvent PreEvent){ PhantasyRealmsEntity.mainRegistry(); proxy.registerRenderThings(); PhantasyRealmsItems.mainRegistry(); CraftingManager.mainRegistry(); modDir = PreEvent.getModConfigurationDirectory(); entityEventHandler = new EventHandlerEntity(); entityEventNetwork = new EventHandlerNetwork(); MinecraftForge.EVENT_BUS.register(entityEventHandler); FMLCommonHandler.instance().bus().register(entityEventNetwork); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); GuiHandler.init(); PacketHandler.init(); } /** * Loads during * @param event */ @EventHandler public static void load(FMLInitializationEvent event){ } /** * Loads after * @param PostEvent */ @EventHandler public static void PostLoad(FMLPostInitializationEvent PostEvent){ } } ServerProxy package com.phantasyrealms.main; import com.phantasyrealms.eventhandler.KeyHandler; import com.phantasyrealms.inventory.InventoryPR; import com.phantasyrealms.packethandling.PacketOpenNormalInventory; import com.phantasyrealms.packethandling.PacketOpenPRInventory; import com.phantasyrealms.packethandling.PacketSyncPR; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.relauncher.Side; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.storage.WorldInfo; public class ServerProxy implements IGuiHandler { public KeyHandler keyHandler; public void registerHandlers() {} public void registerRenderThings(){ } // In your server proxy (mine is named CommonProxy): /** * Returns a side-appropriate EntityPlayer for use during message handling */ public EntityPlayer getPlayerEntity(MessageContext ctx) { return ctx.getServerHandler().playerEntity; } public int addArmor(String armor){ return 0; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case MainRegistry.GUI: return new InventoryPR(player); } return null; } public Object getClientWorld() { // TODO Auto-generated method stub return null; } public static void init() { } }