Jump to content

iGuess19

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by iGuess19

  1. Hey guys, just wanted to give a bit of an update as well as say that I appreciate both of your help. I spent the last couple of days messing with the LivingUpdateEvent to no avail. I was having issues making it so that the player would continue to levitate even if it was more than one block above the levitation block. I saw DavidM's reply and I spent a few hours today messing around with tile entities and just generally trying to get familiar with what I may need and I got it to work! I have a quick question about tile entities and performance though. Since I started playing MC I have always heard that tile entities are lag machines after a certain point. Since my tile entity relies on "tick updates" (may not be proper term) should I be worried about performance? I plan to implement a block for each potion effect so I could see users potentially using many these blocks to make, say, healing rooms with a bunch of regen blocks, or long highways with speed blocks, etc. I also have another question, I'm not sure If I should make a separate post for this but how would I go about stopping the effect once it reaches a non air block above? That way it won't work through ceilings in builds. Right now I'm using a for loop to check from one above the tile entities y position up until world height but that seems disastrous. Is there some kind of ray I could use to check if it hits a solid block? Sorry if these questions seem simple I'm still getting used to the forge api and minecrafts internals. Also, thanks again to both of you. I now have a working block as well as knowing about forge events that may be useful later on.
  2. I'm currently trying to make a block that gradually increases the players y position (levitation) but only while the player is above block. I've looked into onEntityWalk but is only called if the player is directly on the block. I've looked into how soul sand does it with bubble columns but I'd rather not replace all air blocks above the block and instead just use livingEntity.getMotion(). I'm not sure what method I should use so that there are continuous checks to see if a living entity is above the block. Any help is appreciated thanks.
  3. What's up guys? I'm trying to get the coordinates of the block the arrow hits as the title suggests. I'm overriding the onHit(RayTraceResult raytraceResultIn){} method in EntityArrow and I've tried using raytraceresult.hitVec.*Coord as well as this.getPosition.get*(); to get the X and Z Coords, however because its a ray both give me every single X and Z coord that the entity passes through until it is no longer passing through blocks. I only want the coordinates of the first block it touches so that I can use those coordinates to teleport my player to that position. I also noticed that the onHit method in the EntityArrow uses onEntityCollidedWithBlock but the actual method in the block class is empty, so im not entirely sure what its doing or how its being used. If someone would be willing to help it would be much appreciated. I'm also a bit new to java so please excuse the sloppy code https://github.com/iGuess19/aum/blob/master/src/main/java/com/iGuess19/aum/entity/EntityEnderArrow.java
×
×
  • Create New...

Important Information

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