Jump to content

Manslaughter777

Members
  • Posts

    99
  • Joined

  • Last visited

Everything posted by Manslaughter777

  1. G' day, Im trying to make a config file, where if "dirt recipes" is on, allow the user to craft grass and if off, disable the recipe. It does not seem to be working though... This is inside the main class
  2. Hello, Im trying to find an event which is called when the player places a bucket of water or lava. I have found a FillBucketEvent but cant find one for placing the bucket. Is there another event out there that is called when a player places a bucket of water or lava? Cheers
  3. I have found something that works but still not fully correct. int boxWidth = 3; double par1 = boxWidth / 2; for(int i = 0; i < boxWidth; i++) { for(int j = 0; j < boxWidth; j++) { for(int k = 0; k < boxWidth; k++) { Item heldItem = player.getHeldItem().getItem(); //if(player.getHeldItem().getItem().canHarvestBlock()) //System.out.println(heldItem.canHarvestBlock(target, player.getHeldItem())); int x1 = (int)(x - par1 + i); int y1 = (int)(y - par1 + j); int z1 = (int)(z - par1 + k); Block target = world.getBlock(x1, y1, z1); int targetMeta = world.getBlockMetadata(x1, y1, z1); if(ForgeHooks.canToolHarvestBlock(target, targetMeta, player.getHeldItem())) { target.harvestBlock(world, player, x1, y1, z1, targetMeta); world.setBlockToAir(x1, y1, z1); } } } } this seems to work fine only that for some reason dirt doesnt get destroyed???
  4. Hmm, i cant find any of those methods? Are they new in 1.8? cause im still on 1.7...
  5. G' day Ive made an upgrade for the pickaxe where when you break a block, all surrounding blocks get broken too in a 3x3 area. This works but there is a problem. B S S B S S S S S B = bedrock S = stone Lets say I break the center block, all 9 blocks will break even though im using and iron pickaxe which cant break bedrock. What I need to happen is so that when I break the center block, it will only break the stone (or whatever other block an iron pick can break) butnot the bedrock. This is inside BlockBreakEvent int boxWidth = 3; double par1 = boxWidth / 2; for(int i = 0; i < boxWidth; i++) { for(int j = 0; j < boxWidth; j++) { for(int k = 0; k < boxWidth; k++) { Item heldItem = player.getHeldItem().getItem(); //if(player.getHeldItem().getItem().canHarvestBlock()) //System.out.println(heldItem.canHarvestBlock(target, player.getHeldItem())); int x1 = (int)(x - par1 + i); int y1 = (int)(y - par1 + j); int z1 = (int)(z - par1 + k); Block target = world.getBlock(x1, y1, z1); int targetMeta = world.getBlockMetadata(x1, y1, z1); if(heldItem.canHarvestBlock(target, player.getHeldItem())) { target.harvestBlock(world, player, x1, y1, z1, targetMeta); world.setBlockToAir(x1, y1, z1); } } } } That code still makes the bedrock break, however I have also tried the following which somewhat works: int boxWidth = 3; double par1 = boxWidth / 2; for(int i = 0; i < boxWidth; i++) { for(int j = 0; j < boxWidth; j++) { for(int k = 0; k < boxWidth; k++) { Item heldItem = player.getHeldItem().getItem(); //if(player.getHeldItem().getItem().canHarvestBlock()) //System.out.println(heldItem.canHarvestBlock(target, player.getHeldItem())); int x1 = (int)(x - par1 + i); int y1 = (int)(y - par1 + j); int z1 = (int)(z - par1 + k); Block target = world.getBlock(x1, y1, z1); int targetMeta = world.getBlockMetadata(x1, y1, z1); if(world.getBlock((x1, y1, z1) != Blocks.bedrock) { target.harvestBlock(world, player, x1, y1, z1, targetMeta); world.setBlockToAir(x1, y1, z1); } } } } This code DOES work. The pick does not break the bedrock but still breaks the stone. Only problem is that blocks like Obsidian which an iron pick cant mine can still get broken this way. What looking for is something that checks if the block at the coords at x y z can be broken with the held item, and if so break it, otherwise dont. Thnx
  6. Is there a way i can change the texture of the moon in my custom dimension? Looked through the world provider but couldn't find anything... Cheers
  7. I fixed it! Did some research on the "SocketException" and had to run 'netsh winsoc reset'. Now everything is working
  8. Still not working, everytime i run it, it seems to never make any files in C:\Users\john\.gradle\caches\2.0\scripts\build_2n89d7nu8105mn84crl2s6oc0q\ProjectScript\buildscript\ which causes it to fail. Also when i try to launch Minecraft.exe, i get the same message when launching: Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try x/10) Exception: java.net.SocketException: Unrecognized Windows Sockets error: 87: create is it something to do with java?
  9. So im trying to setup forge 1.7.10 and when i run setupDecompWorkspace i get this error: Now, ive gone and looked in C:\Users\john\.gradle\caches\2.0\scripts\build_2n89d7nu8105mn84crl2s6oc0q\ProjectScript\buildscript\ and it is empty! How can i get the files needed in this folder? Thnx
  10. hmm i installed new web security before and it wanted me to delete some files scattered in the cpu, so its probably that. Ill try making a new workspace and see if it works update: yep its that, it failed to setupDecompWorkspace, gotta redownload forge
  11. Ive found another way of doing what i want, so dont worry bout those variables, but ive run into a crash report that i cant even firgure out whats wrong, can u help? It happens as soon as i click on the world
  12. The variables i need are isJumping and jumpTicks, is there a way i can somehow access these protected variables? Thnx
  13. Damn, but i may be able to do an alternative way. Do u know if there is a method like isJumping() in the entity class which says if an entity is jumping or off the ground?
  14. Hey, i am trying to make the potion "jump" not appear in the player inventory when active in my dimension. Im pretty sure to do this i need to create a new potion with the exact same affect as jump but make the forge method shouldRenderInvText() return false. Is there a way i can make a new potion that works the exact same as jump? (There is no PotionJump class to extend) Thnx
  15. Feather Falling would be like knockback resistance. How would i apply the enchantments attribute modifiers?
  16. Hey, does anyone know a way i can add an enchantment like feather falling to a player? (not via armor), or direct me to where it is coded when a player is wearing an enchanted piece of armor, do the following?. Pretty much what i want to do is add "Feather Falling" to the player Thnx
  17. Whenever i open my custom tool inventory with the I key, it opens just fine, but whenever i try to move and click items it goes all weird. If i click an item, it will pick up another one, and some other item will take its place while it gets moved to a different slot. Eg: Apple is in slot 10. Banana is in slot 15. Pear is in slot 20. if i click on apple on slot 10, i will end up picking up banana and pear will take apple's slot while apple is moved elsewhere. KeyInputEvent: Cheers
  18. Thanks dude. Torches will burn out on the moon
  19. Yes, all water blocks to ice. I managed to do this in BlockPlaceEvent, but it only works if the water block is placed from a water block, it doesn't work if its placed with a bucket which is why I'm trying to find an alternate way
  20. that does work, although it doesnt work well as it is the player's position, not the blocks. So what happens if a player goes next to the water, THEN in turns to ice. What i want is wherever i place water, it turns to ice (thats why i need the blocks pos, not the players).
  21. I need to get a blocks x y and z in the world. How would i go about doing that? (Im used to constructors and methods giving me these variables) PlayerTickEvent:
  22. I want to make it so when liquid is placed in my dimension they "freeze". This works fine when i place water from its block, but when i place it from a bucket it does not work... The PlaceBlock event class:
×
×
  • Create New...

Important Information

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