Jump to content

chimera27

Members
  • Posts

    158
  • Joined

  • Last visited

Everything posted by chimera27

  1. Did you make sure the part of the code stopping it is actually running? If it's actually being run, then you might wanna try e.setVelocity(0, 0, 0); that's what I normally use to modify velocities
  2. Under generate, just do: boolean shouldPlace = false; if(world.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } if(shouldPlace){ world.setBlock(yourBlockName); //Or whatever function to generate the block } Keep in mind I just did this on the fly and you WILL have to modify it a bit, but you should be able to handle that... Another thing, the thing you're trying to do will be inherently laggy because it will likely have to run this code for EVERY block (or some constraint of blocks, like every block between y = 50 and y = 90 or whatever). This would apply to almost any solution for this though. (Unless you want the vines to only generate on your custom trees, in which case you could just make the vines generate as part of the tree and it would make about 8039x more sense then this )
  3. The item's NBT is stored for that instance of the item, if you want it to be a stat that will stay even if the player looses their sword and makes a new one, you'll need an extendedplayer. There are a few tutorials on how to do that, they basically store an NBT to the player that will persist through relog, and if you want it to, player death
  4. I would just make a world generator for your vines, and right before the setBlock function add a test to make sure one of the blocks next to it is wood. Here's a descent tutorial on adding worldgen: http://www.minecraftforge.net/wiki/Adding_World_Generation
  5. I would use a NBT compound for storing the kill count, a good tutorial for those is right here: http://www.minecraftforge.net/wiki/How_to_use_NBT_Tag_Compound
  6. int tickssinceshot = 0; if(tickssinceshot = 0){ Do crap Tickssinceshot = 4; } Else { Tickssinceshot--; } Problem solved.
  7. Kind of a hacky solution, but you could make a custom air block or something of the sort generate at the max height of your dimension that is transparent but reduces the light level passing through it (I think there's an easy way to do this in the block, something along the lines of getTranslucency() that you can override)
  8. Why are you trying to store ticks in use as the max use duration? After your constructor, put int tickssincefired = 0; Then in the onUsingItem method put if (tickssincefired = 4){ //Fire the bullet }else { tickssincefired++; } I don't know why you're trying to store it somewhere, it doesn't need to persist across relog or anything like that, and that variable won't get reset any time other then that.
  9. Just add a variable in your item class called tickssincefired, and every tick increase it by one, and if it = 4 then fire a bullet and set it to 0. This is basic logic.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.