Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Atijaf

Members
  • Posts

    198
  • Joined

  • Last visited

Everything posted by Atijaf

  1. Turns out that it will force a chunk to load if it's going to place a block down:)
  2. Well, I changed a little bit of code, but nothing much. Improved the way information is stored, and now it works. Still am unsure as to why the blocks were respawning in the nether and I wish I knew why. Thanks for the help
  3. ..... ugh... It's spawning the block in the nether. Anyone know the cause of this?
  4. Alright, after further debugging... The client side seems to not update, so what I am seeing is not what the server is seeing. The server apparently already placed the block. It returns false if the block it is going to place down is the same block that is already there... or rather, null. I suppose I'm stuck at trying to figure out why the client side is not updating.
  5. After further debugging, I found this bit of code. iblockstate1 is null. blockSnapshot is not null.\ it returns false. The code that defines iblockstate1 as for capitalizing blocks. Yes. Just a typo on this end. I didn't copy and paste.
  6. I'm standing 2 blocks away from the location. Would you know if there'd be a way to force load it? Thanks:)
  7. I am trying to understand why this event is not working. Event The code looks silly and without purpose, but this is a small example of what my code looks like. When it gets to event.world.setBlockState... It returns false, and doesn't place the block. I also get the message when it comes time to place the block, [18:01:19] [server thread/INFO] [FML]: Unloading dimension 1
  8. Which forge event is called every tick? I'm looking for an event that will be called and on every 100 ticks, and be able to place a block at a location.
  9. I decided to add an if statement to check if posX , Y, and Z, are 0. If they are, don't continue. It's working client and server side.
  10. Inside the event, "PlayerEvent.BreakSpeed", returns incorrect blockPos information. More on that... While debugging, the first 3 passes through that event work out fine and return correct information. The last pass through the event returns a BlockPos with the values of 0, 0, 0. tested it with bare minimum amount of code. Thanks!
  11. I have learned that you cannot edit vanilla minecraft's block hardness or harvest levels required. I am now looking for an alternative... How would I make diamond ore drop, even if i'm using my hand or any other tool that does not have the required harvest level to harvest diamond ore?
  12. How do I manually use spoilers? Not working for me:( @SubscribeEvent public void onHarvestBlock(BlockEvent.HarvestDropsEvent event){ world = event.world; pos = event.pos; state = event.state; int fortune = event.fortuneLevel; List<ItemStack> blockDrops = event.state.getBlock().getDrops(world, pos, state, fortune); event.drops.clear(); event.dropChance = 1.0F; for(int i = 0; i < blockDrops.size(); i++){ event.drops.add(blockDrops.get(i)); } }
  13. I'm using "BlockEvent.HarvestDropsEvent event", But it isn't being called because nothing is being dropped. Do I have to declare that it will drop inside the "BlockEvent.BreakEvent event"?
  14. I've tried it in both. While debugging, it shows that it changed it, but once the game starts and i attempt to break it, it doesn't drop. It also breaks as slow as it would using my hand.
  15. I've attempted to change the required harvest level of diamond ore to 0, but it reverts back after the game started. How would I change the required harvest level for a block?
  16. Haha:) I did that immediately after I edited my post. Thanks for the help!
  17. Thanks for the tip! Well I feel slightly embarrassed... I thought it was working. How would I edit or re-declare the "blockStrength" method?
  18. I am wanting to control the speed at which the player can mine blocks. The problem: It seems to work the way I want it to... Except when I go to mine a block with the proper tool. IE. using a diamond pickaxe on diamond ore vs. using your hand on diamond ore. I want both to mine at the same speed. Here is my method: (Sorry, spoilers aren't working) @SubscribeEvent public void onBlockStartBreak(PlayerEvent.BreakSpeed event){ event.newSpeed = 5; } Any idea why a diamond pickaxe would be faster at mining diamond ore than a hand? I know it doesn't make too much sense to do this, but this is the first step in the process and I need to get a better understanding of what's actually going on. Thanks!
  19. Would there be any way to change the hardness value of a meta block, like diorite?
  20. I created a new block and I want it to drop a vanilla diorite block. How would I go about this? Here's my class. Sorry, It wouldn't let me place it in a spoiler. public class stoneBlock extends Block{ public stoneBlock(Material materialIn) { super(materialIn); this.setHarvestLevel("pickaxe", 0); } public Item getItemDropped(IBlockState state, Random rand, int fortune){ return new ItemStack(Item.getItemFromBlock(Blocks.stone), 1, 3); } }
  21. If the player is in the room, he is safe from the outside elements.
  22. Would it be possible to check if a player is inside an enclosed room?
  23. Common mistake:p Overthinking thingsXD Thank you for the help
  24. I tried it, but feel like I didn't do something right because I'm getting an exception. As for the error, I debugged it and it throws an exception on the "event.drops.add" method.
  25. I am subscribing the event BlockEvent.HarvestDropsEvent event and was wondering how make a block, like default stone, drop granite instead. This is my code. Thanks.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.