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

Hello.

 

I've searched through the forum, but the search engine is terrible (or is just messed up in my browser i don't know), but the thing is that i couldn't find a proper answer.

 

I've managed to drop an item at the player's feet with par5EntityPlayer.dropItem()...., but if I play on an actual dedicated server the item is duplicated and I can't pick it up,

 

I've tried use isremote && !isremote but i can't pick the item. It seems out of sync or something.

 

How would I go about dropping an item in a dedicated server???

 

NOTE: I'm using minecraft 1.4.7

 

dedi/integrated is the same thing

 

can we have code or something ?

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

dedi/integrated is the same thing

 

can we have code or something ?

 

I don't know... it seems to be working now... It's weird because sometimes works right away, sometimes you have to use the item a few times in order for the code to work properly:

 

boolean flushed = false;
long start = System.currentTimeMillis();
ItemStack drop;

@Override
public boolean onBlockActivated(World par1World, int par2, int par3,
		int par4, EntityPlayer par5EntityPlayer, int par6, float par7,
		float par8, float par9) {

	if (drop == null) {
		if (par5EntityPlayer.getCurrentEquippedItem() == null) {
			System.out.println("DROP NULL");
			par5EntityPlayer.sendChatToPlayer("DROP NULL");
			return true;
		}
	}

	if (par5EntityPlayer.worldObj.isRemote) {
		System.out.println("CLIENT");
		par5EntityPlayer.sendChatToPlayer("CLIENT");
		return true;
	}

	long end = System.currentTimeMillis();

	if (!flushed) {
		flushed = true;

		drop = par5EntityPlayer.getCurrentEquippedItem().copy();
		par5EntityPlayer.destroyCurrentEquippedItem();

		if (!par5EntityPlayer.worldObj.isRemote)
			par1World.playSoundEffect(par2, par3, par4, "pablisMod.flush",
					1.0f, 1.0f);

	} else {

		if (end - start > 3000) {
			flushed = false;
			start = System.currentTimeMillis();
			drop = null;
		} else {
			if (drop != null) {
				par5EntityPlayer.entityDropItem(drop, 1);
				drop = null;
				System.out.println("DROPPING");
				par5EntityPlayer.sendChatToPlayer("DROPPING");
			}

			par1World.playSoundEffect(par2, par3, par4, "random.click",
					0.3F, 0.6F);

		}
	}

	return true;
}

 

and I noticed that if I use dropItem instead of EntityDropItem the drop never drops...

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.