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

Hey guys, i'm using forge, and i have a problem when generating a few blocks. The way i want it is that if you put specific items in an altars inventory, then the portal will build. This is all working, but the portal actually "isn't" there. I can see them, but the portal block is not working, and also, if i place a block next to the portal block or the portal frame block, it disappears. i am spawning everything from onRandomDisplayTick() maybe that's the problem? here is the code:

 

The Block Altar:

 

public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
	if(canPortalSpawn && !isPortalThere) {
		timeout++;
		//System.out.println(timeout);
		if(timeout == 1) par1World.setBlockWithNotify(par2 + 2, par3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 2) par1World.setBlockWithNotify(par2 + 1, par3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 3) par1World.setBlockWithNotify(par2, par3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 4) par1World.setBlockWithNotify(par2 - 1, par3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 5) par1World.setBlockWithNotify(par2 - 2, par3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 6) par1World.setBlockWithNotify(par2 - 2, par3 + 1, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 7) par1World.setBlockWithNotify(par2 - 2, par3 + 2, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout ==  par1World.setBlockWithNotify(par2 - 2, par3 + 3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 9) par1World.setBlockWithNotify(par2 - 2, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 10) par1World.setBlockWithNotify(par2 - 1, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 11) par1World.setBlockWithNotify(par2, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 12) par1World.setBlockWithNotify(par2 + 1, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 13) par1World.setBlockWithNotify(par2 + 2, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 14) par1World.setBlockWithNotify(par2 + 2, par3 + 4, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 15) par1World.setBlockWithNotify(par2 + 2, par3 + 3, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 16) par1World.setBlockWithNotify(par2 + 2, par3 + 2, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 17) par1World.setBlockWithNotify(par2 + 2, par3 + 1, par4 - 5, MethyrBlocks.MethyrGla.blockID);
		if(timeout == 18) {
			par1World.setBlockWithNotify(par2 + 1, par3 + 1, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2, par3 + 1, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2 - 1, par3 + 1, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2 + 1, par3 + 2, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2, par3 + 2, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2 - 1, par3 + 2, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2 + 1, par3 + 3, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2, par3 + 3, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
			par1World.setBlockWithNotify(par2 - 1, par3 + 3, par4 - 5, MethyrBlocks.MethyrPortal.blockID);
		}
		if(timeout > 19) {
			isPortalThere = true;
		}
	}

}

 

 

The TileEntity:

 

public boolean checkRecipe() {
	boolean bone = false;
	boolean pearl = false;
	boolean emerald = false;
	boolean powder = false;
	for (int i = 0; i < 4; i++) {
		if (inv[i] != null) {
			if (inv[i].getItem().equals(Item.bone)) {
				if (bone) {
					return false;
				} else {
					bone = true;
				}
			}
			if (inv[i].getItem().equals(Item.enderPearl)) {
				if (pearl) {
					return false;
				} else {
					pearl = true;
				}
			}
			if (inv[i].getItem().equals(Item.emerald)) {
				if (emerald) {
					return false;
				} else {
					emerald = true;
				}
			}
			if (inv[i].getItem().equals(Item.blazePowder)) {
				if (powder) {
					return false;
				} else {
					powder = true;
				}
			}
		}
	}

	if (bone && pearl && emerald && powder) {
		MethyrBlockAltar.canPortalSpawn = true;
		return true;
	} else {
		return false;
	}
}

public void updateEntity() {
	checkRecipe();
}

 

 

Please help me out!!!

I don't see any issue with the code you've given, but it could be your portal block... Did you use the nether portal block code as a base?

is this going to be for one of your tutorials because i really need a dimension tutorial.I just keep messing it up.

 

Are you talking to me? I just joined this forum yesterday so I'm not sure what you're talking about... Lol

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.