American2050
Members-
Posts
553 -
Joined
Everything posted by American2050
-
ModelRenderer .addBox To use Floats in all 6 values
American2050 replied to American2050's topic in Modder Support
-
ModelRenderer .addBox To use Floats in all 6 values
American2050 replied to American2050's topic in Modder Support
Thanks guys, I will give it a try -
So I'm experimenting with making Custom models, as for now I always made very basic ones, and using Techne, Techne limits me to use INT values for Size when adding a box. Apparently this is not the case when using Cubik. A friend sent me a model he made on Cubik and it had "float" values on the size, those give an error when trying to add them in the code. Elem12 = new ModelRenderer(this, 0, 0); Elem12.addBox(0F, 0F, 0F, 2, 0.5, 1.5); Looking at the code I see that those second set of 3 values that need to be int, are added later in the code to a float value and from there on, they always used as floats (At least that's what I think) My question is, is there any way to overwrite or do something in my code to be able to send all 6 values as floats? (I guess rewriting the method, but I'm not familiar with things like that) Ok, if anyone have some idea I'm all ears Thanks a lot.
-
BoonieQuafter-CrAfTeR Thanks a lot, yes I finally noticed I was missing that isAIEnabled() Thanks also on the tips about the Boss Bar, that was coming after I figured the AI so thanks a lot on the tips for that aswell Jabelar, thanks a lot, I'm going to take a look at yours tutorials. Also thanks with the tips on how big the Hitbox should be, I think I made mine too big as for now, so I should probably start with the same dimensions the GiantZombie has and test from there
-
Hello forum. So I'm coding a Mob and I'm having some problems with the attributes and AI for it. For example, the first problem I'm having is that I need the mob to follow players to attack from a distance about, lets say 128 blocks. So I have all this, but still seems not taking effect. Is there something I'm missing here? Also, I made it "Giant" like a Giant Zombie, is there anything I should consider when coding a Mob like this? I added some code from the GiantZombie in Minecraft, not really sure what it does and if its really necessary. Thanks for the help The complete code is: package com.mramericanmike.mymod.entity; import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIArrowAttack; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIMoveTowardsTarget; 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.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import com.mramericanmike.mymod.Log; import com.mramericanmike.mymod.init.ModItems; public class EntityMyMob extends EntityMob implements IBossDisplayData, IMob { public EntityMyMob(World world) { super(world); this.experienceValue = 150; this.captureDrops = true; this.setCanPickUpLoot(true); this.isImmuneToFire = true; this.getNavigator().setCanSwim(true); this.setHealth(this.getMaxHealth()); // this.width = 3F; // this.height = 8F; this.addPotionEffect(new PotionEffect(Potion.resistance.id, 24000, 0)); this.yOffset *= 4.0F; this.setSize(this.width * 4.5F, this.height * 5.5F); //AI this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 128.0F)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.75D, true)); this.tasks.addTask(3, new EntityAIMoveTowardsTarget(this, 1.75D, 128.0F)); this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(128.0D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(100.0D); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1000.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.75D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); } public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { return this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_) - 0.5F; } @Override protected boolean canDespawn() { return false; } @Override protected String getHurtSound() { // return "game.hostile.hurt"; Log.Debug("MyMob Hurt"); return null; } @Override protected String getDeathSound() { // return "game.hostile.hurt"; Log.Debug("MyMob Death"); return null; } @Override protected Item getDropItem() { Log.Debug("MyMob Drops"); return ModItems.apple; } } PS: If I'm trying to make a Boss, what attributes and AI do you recommend me to use?
-
Thanks you all guys, I'll give it a try and see how it goes
-
Hi CoolAlias thanks for the answer. Yes I forgot, I'm talking about 1.7.10 It's not an entity (Mobs), but the player. Basically when you spawn in a new world I want to "move" the player into a room, and if he dies once he is out on the world he would have to spawn in this room again. Also thinking about sending them to a new "Void" dimension containing only this room, but that's something I will work on later on.
-
I want to know if is there some function to execute code when you spawn for the first time on a new world. At the same time, is it possible to set the spawn point to a new place and make it exact point, for example X=0, Y=75, Z=0? And always be that point, and not around that area.
-
Which, if you look at it, is just a wrapper function for world.setBlock(x, y, z, Blocks.air, 3) Thanks for the tip, I think I should get used to take a look more into the code itself to see how some things are done "behind the scenes"
-
Not setting them on some Creative Tab will make them invisible to NEI but they would still be able to get them using the /give command. What you can do is not register the items on the public version of your mod. Perhaps you can have a variable like "HiddenItems = true" and leave it like that for when you compile the Mod for your testings and when you going to compile the version for distribution, set that to "false" I think that could work.
-
Thanks you guys I had no idea it worked like that... I'll make that for all the blocks I'm adding to the world, and also, I found a setBlockToAir I guess I will just use that when it's only air what I'm changing... Thanks a lot once again.
-
Hello guys, I have a question about the flags and how to use them when using setBlock It says most likely we want to use 2, but using 2 I have a problem. Lets say I set a lot of block to air, and next to some of the blocks I replaced there was lava, or maybe water. Well the problem I'm having is that using flag 2 the lava doesn't know that the block it not there anymore and as result it doesn't start flowing. world.setBlock(x, y, z, Blocks.air, 0, 2) When I use the flag 1 the blocks still showing, till I try to place something there, then it gets removed and what I placed take the space. Then I see the function description says, "Flags can be added together" but I don't know how to do that. How should I do it, and what flags should I use 1, 2 or 4, all of them?
-
I tired to learn Java several times, but it's way too confusing for me. I think I see what you mean, I will give a try and see if I get it. PS: I'm trying to learn, but again, Java beats me
-
Thanks diesieben07, but I seem to be having some problems, most likely because I'm not really that good and Modding or even with Java lol It works when I do: ItemStack drop0 = new ItemStack(Items.apple,reward,0); EntityItem itemDrop = new EntityItem(world, x, y, z, drop0); world.spawnEntityInWorld(itemDrop); But when I add: ItemStack drop0 = new ItemStack(Items.apple,reward,0); EntityItem itemDrop = new EntityItem(world, x, y, z, drop0); world.spawnEntityInWorld(itemDrop.setVelocity(0F, 0F, 0F)); I get an error saying: The code is like this: public static void init(World world, int x, int y, int z) { //Amount of items final int reward = (int) ((Math.random() * +2); ItemStack drop0 = new ItemStack(Items.apple,reward,0); EntityItem itemDrop = new EntityItem(world, x, y, z, drop0); world.spawnEntityInWorld(itemDrop.setVelocity(0F, 0F, 0F)); } I know I must be falling into some mistake because I'm not sure what I'm doing lol
-
Hello guys, I'm having a problem, I'm making a block spawn items when it's break, but for some reason the spawnEntityInWorld it does spawn the item on the x y x specified but the items float to the west ending at around 1 or 2 blocks to the West from where they were called. Is there a way to fix this? Does this happen for any reason? I know I could do x+1 or x+2 when I call the item to spawn, but it doesn't look good, I would like them to spawn in place and not move. Thanks in advance for any tip
-
I think I know what you mean. But the problem is that when the block is there, it acts like glass, I can see through but I can't interact with whatever is on the other side of it. Now, when I make it invisible I can place blocks through it. I'll take a look at tall grass and see what I can find there, but I think the problem is, my block when invisible doesn't has a collision box... Thanks once again Draco
-
Hey, sorry to get back this old post, but it's about the same. I thought I had a problem, but I think it's a Minecraft problem. So now my question is... Can I do something on the code of my blocks to fix this? Ok, let's describe what going on. I made the invisible, unbreakable block, the problem I have is that leaves can grow on the other side of them. And as you can see on the images, it happens on Minecraft Glass or Stone also (forgot to test bedrock) And the "worst" when I tell my block to be invisible, you can't go through of course, but you can place blocks on the leaves that grow on the other side...(last image) Any idea on what can I do to work around this? Thanks a lot. (Sorry for color changes I have a new Computer and my Corel isn't configured correctly yet)
-
MinecraftForge Functions - Where can I read about?
American2050 replied to American2050's topic in Modder Support
Yes thanks Charsmud, I found the Java docs and it helps a lot, at least to know everything there is available to use (Or most I guess) Thanks TheGreyGhost. Yes, I saw some of the tutorials are really helpful, and yes trial and error or finding a tutorial that explain exactly what we are looking for are the best alternatives apparently. I have done easy things mostly when doing a mod, but I'm trying to learn more to go forward more advanced stuff. Thanks for all the answers -
MinecraftForge Functions - Where can I read about?
American2050 replied to American2050's topic in Modder Support
Well, basically know "everything" we have available to use. Let's say I want to make a block that has to check if other specific block is above it. (Or below, or close, and so on) I'm almost sure there is some function to check for neighbors blocks. But instead of learning all that from Tutorials, where can I look at those... Or it's just by digging around the Minecraft code? -
I think I should have done/ask this time time ago. Is there a place where I can get information about all the functions that we have available and how to implement them? Thanks.
-
Well, I finally went with 2 blocks. One for the walls that water can't break and rain doesn't go through it. And a second one for the roof of my barrier that lets rain pass and can be break by water but as there is no way to place water to it side or above it, players wont be able to do that Not the most elegant solution, but it will do the trick Thanks for the help
-
Fuck if I know. Artifacts is in like four dozen mod packs. I don't keep track of their names. But probably. And to think that mod was merely an exploration of a new design pattern I wanted to experiment with. Ok, yes I was thinking the same, looks like I will have to create my own material. Hopefully I wont drown trying this Sounds scary to me, I'm not that good, just making a ModPack and this Mod with this block, just to fill my needing PS: You should check JonBams some day, everytime he starts a World (He plays Hardcore) the first thing he looks for is an Artifact Tower http://www.twitch.tv/jonbams Man once again, thanks for your help, really appreciate.