Everything posted by Jacknoshima
-
1.7.2 Using an Arithmetic Sequence [SOLVED]
What if you can't reset the counter? I thought about doing it that way but the tick counter is needed for other things as well, so resetting it would screw that up.
-
1.7.2 Using an Arithmetic Sequence [SOLVED]
How would I create an arithmetic sequence (fn = fn-1 + f) and implement it? To explain more fully. I'm wanting an item to do something ever 10,000 ticks. I can make it do something at 10,000 and I can make it do it every number after that by manually entering the numbers in, but doing that for an infinite amount of time would... well... be impossible. So, is there a way for me to use a fn = fn-1 + f sequence and then tell my if statement that if the ticks equal anything in that sequence then it should proceed? I thought about for statements and arrays but I can't work out how it would work. Any help?
-
[1.7.2] Reduce Specific DamageSources? [SOLVED]
Ah, got it, thanks Well, sort of. I can manipulate how much damage it does by plus and minus, but I can't do percentages/multipliers/dividers But, I can work that out now that I know the code actually works, so, yeah, thanks
-
[1.7.2] Reduce Specific DamageSources? [SOLVED]
Okay, so, I'm making some armour, but I want it to reduce fire damage. I've got the doArmorTick set up to give me fire resistance when I want it to, but fire resistance makes you immune to fire damage, and I want it to only, say, half the amount of damage that fire does. Would it be a LivingHurtEvent? If so, how would I go about doing it? Any pointers would be helpful. (Yes, I know there's an enchantment that does this, and I've looked at how that works, but, from what I can gather, most of it is done in the Entity class, and I'd rather not use the enchantment)
-
[1.7.2] Tooltip not working [SOLVED]
... It was the import I was using import java.awt.List; instead of import java.util.List; Thanks for the help
-
[1.7.2] Tooltip not working [SOLVED]
Crap, I copied the code over wrong, the first bit of code was meant to just be a straight String. But yeah, I've tried it as a straight string, and without the @SideOnly, none of them seem to work
-
[1.7.2] Tooltip not working [SOLVED]
Okay, so, I'm trying to add descriptions/information/tooltips to my items. I know I need to use addInformation, but it doesn't seem to be working. I've tried @SideOnly(Side.CLIENT) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("hello"); } and @SideOnly(Side.CLIENT) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(this.description()); } @SideOnly(Side.CLIENT) public String description() { return "Hello"; } as different ways of adding the string I've tried it with and without @SideOnly(Side.CLIENT) but the tooltip/information doesn't seem to be showing up am I missing something?
-
[SOLVED]1.6.4 different setContainerItem problem
Ah, that did it haha Thank you I'll have to remember that for the future I've never done container items like this before, it's always been buckets I've used, so I had no idea they had to be constructed before the one they contain So, yeah, thanks
-
[SOLVED]1.6.4 different setContainerItem problem
well, using the setContainerItem and setting the setContainerItem of "full_bucket_stew" to be "three_bucket_stew" and using "full_bucket_stew" in the crafting grid, it's supposed to return "three_bucket_stew" and the item I've crafted. It doesn't. It just returns the item I've crafted. It's like it won't accept that "three_bucket_stew" is the container item for "full_bucket_stew".
-
[SOLVED]1.6.4 different setContainerItem problem
Okay, so, I managed to get an item to return itself, but now I'm trying to get a different item to return another item and it's not working. I've got four items. full_bucket_stew, three_bucket_stew, two_bucket_stew, one_bucket_stew My idea was to use the setContainerItem method so that, when crafting with a bowl, it would give me a bowl of stew and the next stage down of the stew so full_bucket_stew + bowl = three_bucket_stew + bowl_of_stew sorta thing I figured, as the items are different, with different classes, it should just be .setContainerItem(three_bucket_stew) for full_bucket_stew, but that doesn't work full_bucket_stew = new ItemStewBucketZero(ConfigurationFile.bucket_stew0ID, 2, 0.5F, false).setUnlocalizedName("full_bucket_stew").setCreativeTab(ServerModMain.serverTab).setTextureName("servermod:full_bucket_stew").setContainerItem(three_bucket_stew).setMaxStackSize(1); I can make it return itself, I can make it return ANY other item, but for some reason, beyond my comprehension, it will not return my three_bucket_stew I also tried adding "this.setContainerItem(ServerModItem.three_bucket_stew);" to the constructor of full_bucket_stew but it doesn't work. package servermod.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemStewBucketZero extends ItemFood { public ItemStewBucketZero(int par1, int par2, float par3, boolean par4) { super(par1, par2, par3, par4); this.setContainerItem(ServerModItem.three_bucket_stew); } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { super.onEaten(par1ItemStack, par2World, par3EntityPlayer); if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } return par1ItemStack.stackSize <= 0 ? new ItemStack(ServerModItem.three_bucket_stew) : par1ItemStack; } } (tried them both separate, using it in the constructor and where I intialised it separately, and together, neither worked) So, what am I missing?
-
[SOLVED]1.6.4 setContainerItem help
Nevermind, got it
-
[SOLVED]1.6.4 setContainerItem help
Hey, so, I'm making a knife to work with other items but I want it returned when used in a crafting recipe. I set the "setContainerItem" back to itself but it's still disappearing. From what I've looked up, I can't seem to find any reason why that's happening. this is the initialisation knife = new Item(ConfigurationFile.knifeID).setUnlocalizedName("knife").setCreativeTab(ServerModMain.serverTab).setContainerItem(knife).setTextureName("servermod:knife"); it works when I set the container item to other things but it doesn't work when I set it to itself... Is it just not possible to do or am I missing something?
-
Custom Dispenser Behaviour Help
Yeah, I just needed to put it in the PostInit apparently Thank you ... again haha
-
Custom Dispenser Behaviour Help
Okay, scratch that, it's still not working I added in a new class for the registering and the DispenserBehaviourAdvMobEgg is the same as in my original post I tried adding BlockDispenser.dispenseBehaviorRegistry.putObject(Advmobs.advmobsplacer, new DispenserBehaviourAdvMobEgg()); into the main mod file but to no avail I've also tried changing the method name, extending DispenserBehavior with that name and another name so am I missing something else?
-
Custom Dispenser Behaviour Help
The DispenserBehaviours bit was what I was missing I knew it would be simple Thank you
-
Custom Dispenser Behaviour Help
Okay, I have my custom spawn eggs all set up and they work perfectly Except when I use them with a dispenser they only fire out the egg, not spawn the entity I've made my own dispenser behaviour class here It's basically the same as the vanilla one except I've subsituted ItemMonsterPlacer with my own According to another topic I read they said it needed to be registered, but didn't say how they managed it. I've searched, quite a lot, and can't find any answers on how to register a new dispenser behaviour, if you do actually need to, and I can't find anything about it in the code So, can anyone help me and show me how I'm supposed to register this? or explain why it isn't working? if you need code from my mob placer item I can provide. EDIT: I know this is probably gunna be something really easy, I just can't seem to get it
-
Trouble with adding chat message on interact
yeah, I just got it before I saw your comment Though I found just adding it into a if (!worldObj.isRemote) { addChatMessage("moo") } seemed to work but I'll keep in mind the code you've given me for future use if I need to do more complex stuff with it
-
Trouble with adding chat message on interact
it seems to add the chat message twice even if I don't have it under the if statement as in still adds it twice
-
Trouble with adding chat message on interact
Okay, so, I wanted to add a chat message when interacting with an entity I got it to send the chat message but, for some reason, it sends it twice here is the code can anyone tell me why it's sending the chat message twice?
-
[1.6.2] What am I doing wrong? (Creating custom bow)
I think that about inexperience with Java was aimed at me, but he really could do with making himself clearer anyway, not being as vague as possible.
-
[1.6.2] What am I doing wrong? (Creating custom bow)
Yes, I know about Java. I know that extending a class means the class inherits everything from the class you've extended I didn't need to override register icons because I use the func_111206_d way of getting icons, so the item icon was the same if it hadn't been for RavynousHunter explaining in the post below yours, I would've assumed the way that the animation textures are called is the same way, as I didn't know you had to call each individual texture in the array from your location, I just assumed it took the location specified in func_111206_d and added it on, which is what the "this.func_111208_A() + "_" + bowPullIconNameArray" thing does. My error using the vanilla code is simply that I didn't know you had to add the modid in front of the file names in the array, which I hardly think is indicative of me not knowing java. And RavynousHunter, thanks for the code it is a lot more compact than my way haha I hope the ItemRenderer works for you
-
How do you make plants grow on custom blocks?
okay, I'll look into it thanks
-
[1.6.2] What am I doing wrong? (Creating custom bow)
I tested it with a new class that extends ItemBow with no other code than the constructor unless there's certain code that needs to be copied over and certain code that doesn't, it doesn't work if you know how to do it without having to use the method I used in my original code, why don't you just show it and/or explain it instead of being so vague? because, honestly, at this point, it kinda seems like you don't really know what you're talking about with this one... EDIT: Also, RavynousHunter this is the ItemRender for the bow https://gist.github.com/SanAndreasP/5608824 and you need to add MinecraftForgeClient.registerItemRenderer(YourMod.custombow.itemID, new RenderCustomBow()); under your load method in the main mod file
-
How do you make plants grow on custom blocks?
In which you mean I need to look in the Block.class file, find the "canSustainPlant" method and make my own? okay, then how do I call it in the canBlockStay method? or, how can I create a new EnumPlantType so that I can avoid having to make my own canSustainPlant and just add my custom dirt/grass to the already existing list?
-
[1.6.2] What am I doing wrong? (Creating custom bow)
... extending ItemBow does nothing... I'm pretty sure I tested it when I made my first bow in 1.6.2 originally and I literally just tested it now and the pull back animation doesn't work when you just extend ItemBow...
IPS spam blocked by CleanTalk.