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

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

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

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

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

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

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

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

    • Reach Out To Rapid Digital: What sapp Info: +1 41 4 80 7 14 85 Email INFO: rap iddi gita lrecov ery @ exe cs. com Hello, my name is Jayson, and I’m 35 years old from the United Kingdom. My family and I recently endured an incredibly challenging experience that I wouldn’t wish on anyone. We became victims of a cryptocurrency investment fraud scheme that saw us lose a staggering $807,000 in USDT and Bitcoins. The fraudsters had created a convincing facade, and we were lured into investing, only to discover later that the platform was a complete scam. We were left devastated, not just financially, but emotionally, as we had trusted these people and believed in the legitimacy of the investment. After the initial shock wore off, we desperately searched for ways to recover the lost funds. It seemed like an impossible task, and we felt as though there was no hope. That’s when, by sheer luck, we stumbled across a post about Rapid Digital Recovery, a cryptocurrency and funds recovery organization with a proven track record in cybersecurity and fraud recovery. We decided to reach out to them, and from the first interaction, we were impressed with their professionalism and transparency. They explained the recovery process in detail and reassured us that they had the skills and expertise to track down the perpetrators and recover our funds. This gave us a renewed sense of hope, something we hadn’t felt in months. What truly stood out during our experience with Rapid Digital Recovery was their dedication to the recovery process. The team went above and beyond, using sophisticated tracking tools and cyber forensics to gather critical information. Within a matter of weeks, they had successfully located the funds and traced the scam back to the fraudsters responsible. They worked with the authorities to ensure the criminals were held accountable for their actions. To our relief, the team at Rapid Digital Recovery was able to recover every single penny we had lost. The funds were returned in full, and the sense of closure we felt was invaluable. We couldn’t have imagined such a positive outcome in the early stages of our recovery journey, and we are deeply grateful for the work they did. If you ever find yourself in a similar situation, I highly recommend contacting Rapid Digital Recovery. Their expertise, transparency, and dedication to their clients make them the go-to choice for anyone seeking to recover lost cryptocurrency or funds. They truly gave us back our financial future.  
    • This is my first time modding anything, so maybe just skill issue. I'm using Forge 54.0.12 and Temurin 21.0.5+11-LTS I wanted to create a custom keybind and to check whether it works I'd like to send a chat message. I tried using Minecraft.getInstance().player.sendSystemMessage(Component.literal("test")); but IntelliJ couldnt resolve sendSystemMessage(...). Since I saw people using it in earlier versions, I tried the same thing with 1.20.6(- 50.1.0), where it works fine, now I can't figure out if this is intentional and whether there are other options for sending chat messages. On that note, is there more documentation than https://docs.minecraftforge.net/en/1.21.x/? It seems very incomplete compared to something like the Oracle Java docs
    • Hi, i'm having this error and I wanna fix it. we try: -Reload drivers -Eliminate .minecraft -Eliminate Java -Restart launcher -Verify if minecraft is using gpu -Mods  in .minecraft is empty -Install the latest and recomended version of forge idk what i have to do, help me pls. the lastest log is: https://mclo.gs/WAMao8x  
    • Read the FAQ, Rule #2. (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/)  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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