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.

[1.7.10+][SOLVED-Using tracker] Player view-distance for Entities.

Featured Replies

Posted

What's the range player sees Entities? (other PlayerEntity most important)

 

Is it same for all?

 

Is it constraint? Server has "view-distance=10" to max 15, this is only for world-sending or also Entities? If for Both - how do I get that range? (probably somewhere in MinecraftServer).

 

When player logs in, other clients generate their EntityPlayer (I belive so), do they know (client-side) other player coordinates when thay are NOT in view range?

 

Looking on my own (it's pain in the ass to test it with 2 clients, running around on server map checking Syso), might aswell get some of answers faster here. Thanks :)

 

Reason: Sending packet to all around. (should be in visible-range)

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Thanks, that probably just saved me from literally writing my own tracker.

 

//Server-side
public void onAttributeModified(AttributeKeys key, AttributeSources source) // this.player is player owning attribute
{
EntityTracker entitytracker = ((WorldServer)this.player.worldObj).getEntityTracker();
			for (EntityPlayer p : entitytracker.getTrackingPlayers(this.player))
			{
				PacketDispatcher.sendTo(new PacketUpdateAttribute(this.getAttribute(key, source)), p);
			}
}

 

So this is how I do it? (can't even launch MC now because of tons of other errors - WIP stuff)

 

Also: Is the player being tracked also in tracking set? (you know logically - client tracks its entityPlayer)

 

Again - thanks :P Thread is most-likely resolved

1.7.10 is no longer supported by forge, you are on your own.

  • Author

I tried, but: Packet != IMessage :C

public void func_151247_a(Entity p_151247_1_, Packet p_151247_2_)
public void func_151248_b(Entity p_151248_1_, Packet p_151248_2_)

 

And they seem like they are literally doing same stuff (iterating).

 

Unless I will start extending Packet for that ;p

1.7.10 is no longer supported by forge, you are on your own.

  • Author

As always, diesieben to the rescue! :)

Nice to learn this stuff exists.

 

Thread marked SOLVED.

Thanks.

1.7.10 is no longer supported by forge, you are on your own.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.