Jump to content

Recommended Posts

Posted

so, my idea of doing it was  to make a  variable bounding/collision box  and then an onentitycollision event

however, to do this you'd need to be able to be walking through the bounding/collision box

 

 

the point of this is to blow an entity up and leave it floating there untill it moves away from the blocks underneath

 

If anyone knows how to do this, or maybe has a better solution please tell me! :)

Posted

List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox((float) xCoord, (float) yCoord, (float) zCoord, (float) (xCoord + 1), (float) (yCoord + 2), (float) (zCoord + 1)));

 

that should give you a list of every entity in or above your TileEntity, shouldn't be too difficult to modify it to do what you need. i recommend you change the Entity.class part to something more specific.

Posted
  On 4/9/2013 at 6:49 PM, khm said:

List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox((float) xCoord, (float) yCoord, (float) zCoord, (float) (xCoord + 1), (float) (yCoord + 2), (float) (zCoord + 1)));

 

that should give you a list of every entity in or above your TileEntity, shouldn't be too difficult to modify it to do what you need. i recommend you change the Entity.class part to something more specific.

 

im sorry im kind of a beginner X D

the only thing i couldnt make work was the worldObj  any suggestions on how to declare it?

Posted
  On 4/9/2013 at 7:14 PM, Silverkill95 said:

  Quote

List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox((float) xCoord, (float) yCoord, (float) zCoord, (float) (xCoord + 1), (float) (yCoord + 2), (float) (zCoord + 1)));

 

that should give you a list of every entity in or above your TileEntity, shouldn't be too difficult to modify it to do what you need. i recommend you change the Entity.class part to something more specific.

 

im sorry im kind of a beginner X D

the only thing i couldnt make work was the worldObj  any suggestions on how to declare it?

never mind, i just figured out how to fix it :P

however it still doesnt make a collision box... or maybe im just doing something wrong, let me play around with it a lil more :P

Posted

unfortunately (as far as i know) it is not possible to make a collation box that extends outside of your cubic meter box as that the collation detection function will not even look at your collation box unless the entity is colliding with the cubic meter space assigned to your block. so to check for entities outside this area, you have to manually call collision detection every tick or so.

Posted
  On 4/9/2013 at 7:29 PM, khm said:

unfortunately (as far as i know) it is not possible to make a collation box that extends outside of your cubic meter box as that the collation detection function will not even look at your collation box unless the entity is colliding with the cubic meter space assigned to your block. so to check for entities outside this area, you have to manually call collision detection every tick or so.

so do you have any other suggestions of detecting an entity and then give velocity to that entity while being 10 blocks close

 

this is what the objective is : the entity is walking over the block it gets pushed up untill its 10 blocks higher then the block itself

idc what  other way i need to do it i just want it to work :)

Posted

i'm afraid running that in the updateEntity function of a TileEntity is the only way i know of to find entities outside the space your block occupies. as for pushing entities, i have never tried it before but the first thing that comes to mind is just simply adding some number to the posY of the entity:

 

    @Override

    public void updateEntity()

    {

          List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox((float) (xCoord -9), (float) yCoord, (float) (zCoord - 9), (float) (xCoord + 11), (float) (yCoord + 11), (float) (zCoord + 11)));

          for(int i=0; i < list.size(); i++)

          {

              Entity e = (Entity) list.get(i);

              e.posY += 0.1D;

          }

    }

Posted
  On 4/9/2013 at 8:41 PM, khm said:

i'm afraid running that in the updateEntity function of a TileEntity is the only way i know of to find entities outside the space your block occupies. as for pushing entities, i have never tried it before but the first thing that comes to mind is just simply adding some number to the posY of the entity:

 

    @Override

    public void updateEntity()

    {

          List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox((float) (xCoord -9), (float) yCoord, (float) (zCoord - 9), (float) (xCoord + 11), (float) (yCoord + 11), (float) (zCoord + 11)));

          for(int i=0; i < list.size(); i++)

          {

              Entity e = (Entity) list.get(i);

              e.posY += 0.1D;

          }

    }

it didnt work out and i couldnt seem to fix it :S

this still leaves me without a fix :(

Posted

Could it be possible to create a condition that takes the coordinates of the player and of the block/tileentity, and subtracts the distance from one of the two and takes the absolute value of your result and then uses an if statement? Im not 100% sure but sounds like it would work if you knew how to do it.

This is the creator of the Rareores mod! Be sure to check it out at

Posted
  On 4/11/2013 at 11:02 AM, Noah_Beech said:

Could it be possible to create a condition that takes the coordinates of the player and of the block/tileentity, and subtracts the distance from one of the two and takes the absolute value of your result and then uses an if statement? Im not 100% sure but sounds like it would work if you knew how to do it.

yes but what would trigger the event of moving the entity.....

Posted

i'm guessing from the pm you sent me that you don't have your TileEntity set up properly. for starters the class you put it in needs to extend TileEntity.

 

public class CustomTileEntity extends TileEntity
{
     @Override
     public void updateEntity()
     {
          //your code here
     }
}

 

and then your bock needs to tell minecraft that it has a TileEntity

 

public class BlockCustom extends Block implements ITileEntityProvider
{
     @Override
     public TileEntity createNewTileEntity(World par1World)
     {
          return new CustomTileEntity();
     }
}

 

and then you need to register your TileEntity

 

     @Init
     public void load(FMLInitializationEvent event)
     {
          //some code
          GameRegistry.registerTileEntity(CustomTileEntity.class, "CustomTileEntity");
          //some more code
     }

Posted
  On 4/11/2013 at 3:31 PM, khm said:

i'm guessing from the pm you sent me that you don't have your TileEntity set up properly. for starters the class you put it in needs to extend TileEntity.

 

public class CustomTileEntity extends TileEntity
{
     @Override
     public void updateEntity()
     {
          //your code here
     }
}

 

and then your bock needs to tell minecraft that it has a TileEntity

 

public class BlockCustom extends Block implements ITileEntityProvider
{
     @Override
     public TileEntity createNewTileEntity(World par1World)
     {
          return new CustomTileEntity();
     }
}

 

and then you need to register your TileEntity

 

     @Init
     public void load(FMLInitializationEvent event)
     {
          //some code
          GameRegistry.registerTileEntity(CustomTileEntity.class, "CustomTileEntity");
          //some more code
     }

oh im sorry lol ....  this is my first time modding... so i didnt know

but ima try adding this as quick as i can and then hopefully it will work :D

Posted
  On 4/11/2013 at 3:31 PM, khm said:

i'm guessing from the pm you sent me that you don't have your TileEntity set up properly. for starters the class you put it in needs to extend TileEntity.

 

public class CustomTileEntity extends TileEntity
{
     @Override
     public void updateEntity()
     {
          //your code here
     }
}

 

and then your bock needs to tell minecraft that it has a TileEntity

 

public class BlockCustom extends Block implements ITileEntityProvider
{
     @Override
     public TileEntity createNewTileEntity(World par1World)
     {
          return new CustomTileEntity();
     }
}

 

and then you need to register your TileEntity

 

     @Init
     public void load(FMLInitializationEvent event)
     {
          //some code
          GameRegistry.registerTileEntity(CustomTileEntity.class, "CustomTileEntity");
          //some more code
     }

 

OMFG DUDE IT FINALLY WORKS THANK YOU SO MUCH!!!!!!!!!

however your values were very very off  when u went in a 20 block radius of the block it would already push you

however another friend helped me fix the coord values

so now it finally works :D

!!!!!

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • my game keeps crashing right before launching the game before full screen and keeps poping up this error message "error code 1 " The game crashed: rendering overlay Error: java.lang.IllegalAccessError: failed to access class com.mojang.blaze3d.platform.GlStateManager$TextureState from class net.coderbot.iris.gl.IrisRenderSystem$DSAARB (com.mojang.blaze3d.platform.GlStateManager$TextureState is in module minecraft@1.18.2 of loader 'TRANSFORMER' @d919544; net.coderbot.iris.gl.IrisRenderSystem$DSAARB is in module oculus@1.6.4 of loader 'TRANSFORMER' @d919544)
    • removing oculus or any of ETF or EMF or even embeddium doesn't change anything it just crashes again with error -1  https://gist.github.com/Tikalian-coconut/d49e8fb83bf57d5e04eb042522046786 this time i removed all 4 at same time and that gave it something is wrong with the game seriously..
    • crash report -> https://gist.github.com/Tikalian-coconut/18c41f97bdacef54725e5141f57697d7 from what i see it seems like Entity Texture Features doesn't like Oculus doing something or invert.. not sure it's why everything is all black textured but that causes a -1 error
    • well that's bad, cuz there's no crash report at all (the last crash report is from previous replies) it's probably another issue that doesn't fit in this bug report, the game works fine except that everything is black, no texture except the sky and skin, everything else is just black i've tried reloading the textures in game, see for drivers updates but it did nothing, seems like an issue with Embeddium or Oculus i think, but i know nothing compared to you i can still send the latest debug and latest.log files.. edit: it seems that when i re-add rechiseled (1.1.6-1.20.1) it crashes as error 1 (i can't remove it off from the modpack cuz that'll break all my builds on some maps) lemme start the game and get it to crash to get a crash report done)
    • If you've fallen victim to a crypto scam, you're not alone and thankfully, you're not without options. I highly recommend iBolt Cyber Hacker Company for anyone seeking professional and effective assistance in recovering scammed cryptocurrency. After extensive research and hearing from multiple satisfied clients, it's clear that iBolt stands out in a crowded and often unreliable market. Their team of experienced cyber experts and blockchain analysts uses advanced tracking techniques to follow stolen funds across the blockchain and engage with crypto exchanges when possible. They’re not just tech-savvy—they’re strategic and persistent. WHY CHOOSE iBOLT CYBER HACKER COMPANY? (1) Proven success in crypto asset recovery (2) Fast, professional, and discreet service (3) Skilled in blockchain forensics and cyber investigation (4) Committed to fighting online fraud and supporting victims Don’t give up. I strongly recommend reaching out to iBolt Cyber Hacker Company. ENQUIRIES: info @ iboltcyberhack . org/ www . iboltcyberhack. org/ +39. 351. 105. 3619.
  • Topics

×
×
  • Create New...

Important Information

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