Jump to content

Robertusxd

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Robertusxd

  1. i found the solution, this.attacker.inventory.setPickedItemStack(this.getBestAttackItem()); is not working correctly and only showing you client side that u are holding that item. on the server i was hitting the monsters with bare hands.
  2. some information: i have applied an AITask to the EntityPlayerSP that attacks every EntityMob that gets within attack range. it works fine but for some reason the automated attacks take 10+ hits to kill a mob with a diamond sword. private void performAttack(EntityLivingBase target) { this.lastAttackTick = Minecraft.getMinecraft().world.getTotalWorldTime(); this.attacker.inventory.setPickedItemStack(this.getBestAttackItem()); this.attacker.swingArm(EnumHand.MAIN_HAND); Minecraft.getMinecraft().playerController.attackEntity(this.attacker, target); } this is the code that performs the attack. the field lastAttackTick is used to make sure that i only attack when its supposed to deal full damage. before i used if(this.attacker.getCooledAttackStrength(0F) == 1) but i had the same problem with that. getBestAttackItem() returns the ItemStack with the most ATTACK_DAMAGE in the players inventory. i hope i offered enough information and someone know what the problem is thanks in advance
  3. Sry if im just being dumb or blind but i cant seem to find a render tutorial thats not completly outdated. So if someone could point me in the right direction i'd be thankful. Right now im looking to render a custom projectile if that matters. Thanks in advance.
  4. you are my hero right now, thank you so much
  5. yes im in survival mode as i said the setAttackTarget method of the entity gets called but the entity does not react to it.
  6. i tried it but it didnt change anything
  7. So my problem is that my Entity does not attack. Its not just dealing no damage it does not even move towards the target or do anything at all really. Entity: https://pastebin.com/d9dAzjM0 EntityNeutral: https://pastebin.com/R2R1Raqx WalkHomeAi: https://pastebin.com/1ECiWBsD AttackAI: https://pastebin.com/08Xvq8tt But i dont think it is a problem with my AI since i also tried Minecrafts AIs EntityAIHurtByTarget and EntityAINearestAttackableTarget and they didnt work either. I also used System.out.println to see if the setattacktarget method of my entity is called and it does get called.
  8. thanks alot guys
  9. yea im using my account, how can i run it without mine?
  10. thats how i start the server, but how do i get two clients on that server? when i start 2 clients afterwards they have the same name and one of them joining kicks the other one
  11. im using eclipse, not quite sure how to do that
  12. thats the first thing i found when i googled it but im not a 100% sure on how to use it. i tried it out but i have no real way to test it in single player
  13. Thats super helpful thank you. i will try it out later
  14. So i been looking around a little but didnt really find a way to do this. Im basicially creating a gamemode where two teams are playing against each other and within these teams the players should not be abe to attack each other. So what i need is to turn off PvP between some Players but towards other Players it still has to be turned on. I hope there is a way to do that and thanks in advance.
  15. oh wow, i did the exact same thing you did, i knew Minecraft.getMinecraft() was client side but apparently i still used it anyways. thanks alot
  16. Yes it does get run because the inventory in the gui actually changes, but it seems like the changes dont get saved. i uploaded a short video that hopefully explains the problem better https://youtu.be/DvVKD6hG7lY @glassManMCID20 hope we both find a solution here if u find a solution somewhere else please let me know
  17. @Draco18s sry should have specified that, TowncenterButtons.PLUS is the button im talking about https://github.com/robertusengel/aoemod/blob/80ca12cd420ca9b2879f54841edbfaeca5936678/network/TowncenterMessage.java#L47 thats the line that basicially changes it, but doesnt really save it the test method is in the tile entity public void test() { inventory.extractItem(0, 10, false); this.markDirty(); }
  18. Hello, im trying to create a Tile Entitie with Inventory and GUI that changes the content of the inventory when a button on the gui is clicked. my problem is that the change to the inventoy does not really get saved. when i click the button i see the content change, but when i close the gui and reopen it its back to pre button click. Container: https://github.com/robertusengel/aoemod/blob/master/blocks/towncentergui/ContainerTowncenter.java GuiContainer: https://github.com/robertusengel/aoemod/blob/master/blocks/towncentergui/GuiTowncenter.java TileEntity: https://github.com/robertusengel/aoemod/blob/master/blocks/towncentergui/TileEntityTowncenter.java Message: https://github.com/robertusengel/aoemod/blob/master/network/TowncenterMessage.java i hope i didnt forget anything relevant thanks in advance
  19. oh wow that really was it, thank you so much.
  20. I've been trying to create a Tile Entitiy with Inventory GUI for a while now but i cant seem to make it work. It basicially does not save any items dragged over and throws an IndexOutOfBoundsException when i click on some Slots. So right now im basicially just trying to copy a chest, but its only 1 block not 2 right next to each other. the IndexOutOfBoundsException gets thrown when ever i click on a slot in the red. http://i.imgur.com/5Czo0uK.png The block: https://pastebin.com/dVghZmGm Tileentity: https://pastebin.com/wXqvtzC3 GuiContainer: https://pastebin.com/g16dpdas Container: https://pastebin.com/F25E58zz GuiHandler: https://pastebin.com/WxSTmQFh error: https://pastebin.com/71dyasmJ I register the GuiHandler in the preInit of the CommonProxy and I register the TileEntity after I register the Blocks. any help appreciated
  21. @drok0920 thanks for ur answer, i had an idea similar to that, im gonna loop from the highest block to 0 and find the first non log/leaf block.
  22. @jeffryfisher thanks for ur answer, i just implemented the idea of filling up, but a problem i have is that trees are causing my method to fill it up way too high. do u know an efficient method to ignore trees or maybe remove them from the chunk?
  23. Hello guys, I hope the answers to my questions arent obvious. I like to think that im decently experienced in Java but im completly new to Minecraft modding. From what ive seen 1.12 changed a lot of things(?) so maybe thats why its so hard to get any information thats actually up to date. So what im trying to do is having the WorldGenerator build a house at the spawnlocation. 1.What would be the best way to modify the WorldGenerator in a way that makes sure the spawnlocation is rather flat so that a building doesnt look completly out of place? 2.What would be the best way to then actually place a building there? I have tried implementing the IWorldGenerator interface but im not quite sure if thats the best way to ensure that the area is rather flat. It worked for building a house by changing the blockstates of the blocks relative to the spawn BlockPos but im not sure if that is the best way to go about this. Thanks for any help in advance.
×
×
  • Create New...

Important Information

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