Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

so i have a code that ray trace entity but just like 7 blocks away(i cant manage the raytrace distance) and i want to know if there is a better way to do it (if i can manage the detecting distance IS BETTER)

RayTraceResult entityResult = Minecraft.getInstance().objectMouseOver;
if(entityResult.getType() == RayTraceResult.Type.ENTITY) {
      Entity lookedEntity = ((EntityRayTraceResult)entityResult).getEntity();
	  lookedEntity.DOSOMETHINGWITHLOOKEDENTITY;
}

)

Edited by ElTotisPro50

  • Author
10 hours ago, diesieben07 said:

This is client side only, so most likely this doesn't do what you want. Look at BucketItem for an example.

And you once again posted in the wrong Forum.

it uses the method raytrace "if Type.BLOCK"  but i dont see anything about .Type.ENTITY or the cow for extract its milk

 

are you sure im in the wrong spot my post says 14 hours ago in Modder Support, it doesnt say in forgegradle and i wrote the post in Modder Support only hmm

Edited by ElTotisPro50

  • Author
10 hours ago, diesieben07 said:

This is client side only, so most likely this doesn't do what you want. Look at BucketItem for an example.

And you once again posted in the wrong Forum.

would this work?

RayTraceResult entityResult = rayTrace(world,player, RayTraceContext.FluidMode.NONE);

if(entityResult.getType() == RayTraceResult.Type.ENTITY) {
      LivingEntity lookedEntity = (LivingEntity)((EntityRayTraceResult)entityResult).getEntity();
}

 

  • Author
1 hour ago, diesieben07 said:

There is no method to do entity ray tracing on the server (mostly because it won't be accurate).

What are you trying to do?

for example remove the entity im looking at or give it glowing effect or set it on fire

  • Author
1 hour ago, diesieben07 said:

Under what circumstances?

hmm, when i right click my item, give glowing to the entity im looking at(with raytrace)

i dont want a method or event that detects if i right click an entity because i want to give it the effect at more distance(it would be nice if i can controll the entity detecting distance)

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.