Everything posted by Caleb6801
-
[1.7.10]How do I add a delay to my script?
Hi, so I have a script that adds a potion to the player when holding the item, but it constantly adding the effect so it gives it no time to count down. All I want is a simple line of code that delays the script for 2 seconds l, giving it enough time for the potion to count down for a little bit.
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
Thanks, all I needed to do was add the if(!world.isRemote)
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
Is there an easier way to add a delay in my script after I do: player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 100, 0)); ??
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
I'm new to this and don't get any of what you just said. I'm probably just going to change the potion effect of that item
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
I am not sure how to do that, if you could explain, because right now my code just adds regeneration every tick.
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
Or I want to add a delay in my script after the potion effect is added.
-
[SOLVED]How do I Call a Part of a Script Every 3 Seconds
Hi, so I have a item that when held adds the regeneration effect to you. But for the regeneration to work it needs to tick down, so I want to call the script that adds the potion every three seconds when the item is held. This is the script I want called every 3 seconds: @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ super.onUpdate(stack, world, entity, par4, par5); EntityPlayer player = (EntityPlayer) entity; ItemStack equipped = player.getCurrentEquippedItem(); if(equipped == stack){ player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 60, 2)); } } Thanks in advanced!
-
[Solved][1.7.10]How do I ge Regeneration working?
When I put the: player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 5, 4)); for jump boost 5, it only gives me jump boost 3. I don't know why.
-
[Solved][1.7.10]How do I ge Regeneration working?
Okay thanks, also will Regeneration 4 and 5 work or is that not possible? And do you know how to get jump boost 5 working or is that not possible also?
-
[Solved][1.7.10]How do I ge Regeneration working?
Hi, so I have a script that adds Regeneration when holding a certain item. It adds the regeneration but the regeneration does not work as in it does not regenerate my hearts. I am using this to add regeneration: player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 5, 2)); <---Adds Regeneation 3 for 5 ticks. Also I want to have jump boost five working using that same code, I have jump boost 1,2,3 and 4 working but not 5. I am using: player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 5, 4)); <---Adds jump boost 5 for 5 ticks. If this is not possible to get jump boost 5 please tell me and I'll just remove it from my mod. Thanks in advanced!
-
[Solved][1.7.10]Code for mod is not working, please help!
OMG!! That worked! Thanks so much, and sorry for being such a noob and asking so many pointless questions.
-
[Solved][1.7.10]Code for mod is not working, please help!
Ignore my last response, I'll try that and tell you whats happens.
-
[Solved][1.7.10]Code for mod is not working, please help!
Sorry but I'm new to the detect item stuff.
-
[Solved][1.7.10]Code for mod is not working, please help!
Okay, so what do I put if not new Item()
-
[Solved][1.7.10]Code for mod is not working, please help!
You told me to register the item, and then I asked how and you told me to put the code in that I already have.
-
[Solved][1.7.10]Code for mod is not working, please help!
What's the point of adding that code if I already have it?
-
[Solved][1.7.10]Code for mod is not working, please help!
Okay so what do I do? I thought I registered the SpeedStick?
-
[Solved][1.7.10]Code for mod is not working, please help!
Whole class: http://pastebin.com/Tk1DuxEc
-
[Solved][1.7.10]Code for mod is not working, please help!
The println messages are not apearing. The first line: public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ println message isnt even apearing
-
[Solved][1.7.10]Code for mod is not working, please help!
I have tryed if(!world.isRemote && entity instanceof EntityPlayer){ player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 5, 3)); } NO luck though
-
[Solved][1.7.10]Code for mod is not working, please help!
I have never touched this part of mods before, so can someone please help me out and insert what everyone is telling me to insert into the proper place, because i don't know where to put it.
-
[Solved][1.7.10]Code for mod is not working, please help!
New code: @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ System.out.println("First update is Successfull"); super.onUpdate(stack, world, entity, par4, par5); System.out.println("Update Successfull"); EntityPlayer player = (EntityPlayer) entity; ItemStack equipped = player.getCurrentEquippedItem(); System.out.println("Found held item"); System.out.println("Found Item Successfully"); player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 5, 3)); System.out.println("Added Potion Effect Successfully"); }
-
[Solved][1.7.10]Code for mod is not working, please help!
I have removed those extra brackets and the if statement but still, nothing working.
-
[Solved][1.7.10]Code for mod is not working, please help!
Just wondering how would I check if it's a player first? Sorry about PM'ing you I just needed a fast repsonse.
-
[Solved][1.7.10]Code for mod is not working, please help!
My full code for that item is: package com.farline.item; import com.farline.creativetabs.MCreativeTabs; import com.farline.lib.RefStrings; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import net.minecraftforge.common.util.EnumHelper; import cpw.mods.fml.common.registry.GameRegistry; public class SpeedStick extends Item{ public SpeedStick() { this.setFull3D(); } public static void main(String[] args){ } public static void mainRegistry(){ initializeItem(); registerItem(); } public static Item sStick; public static void initializeItem(){ sStick = new Item().setUnlocalizedName("sStick").setMaxStackSize(1).setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":SpeedStick"); } public static void registerItem(){ GameRegistry.registerItem(sStick, sStick.getUnlocalizedName()); System.out.println("Added Item Successfully"); } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ System.out.println("First update is Successfull"); super.onUpdate(stack, world, entity, par4, par5); System.out.println("Update Successfull"); { EntityPlayer player = (EntityPlayer) entity; ItemStack equipped = player.getCurrentEquippedItem(); System.out.println("Found held item"); if(player.getCurrentEquippedItem().equals(stack)){ System.out.println("Found Item Successfully"); player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 5, 3)); System.out.println("Added Potion Effect Successfully"); } } } } If that helps at all.
IPS spam blocked by CleanTalk.