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

I am trying to make the world place a fluid inside of a nether portal type structure that spawns a Portal to my custom dimension. I have been told that I should cause a block update to make it spawn the portal after the fluid is placed. How would I go about doing this?

  • Author

hi

 

try World.scheduleBlockUpdate()

 

(must be done on the server)

 

-TGG

 

It still just spawns the fluid inside of the portal frame and doesn't actually create a portal...

  • Author

What makes the portal in the code? the portal frame or the fluid

 

I think the fluid, because I just changed that portion of the vanilla code from fire to my fluid. Then I gave my fluid fire like properties. I can place the fluid in my frame normally and create the portal. I just cant get the world to place it.

  • Author

Give us the class that has the portal creating functionality

 

Here is the part that creates the portal after I kill a certain entity:

 

 

 

private void createHeavenPortal(int x2, int z2){

int x = x2 + rand.nextInt(15);

int z = z2 + rand.nextInt(15);

 

int y = worldObj.getHeightValue(x,z)-1;

 

    worldObj.setBlock(x + 0, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 2, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 1, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 1, z + 0, FaithCraft2.WineBlock, 0, 3); <--- Fluid

worldObj.setBlock(x + 3, y + 1, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 2, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 2, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 3, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 3, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 2, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

    }

 

 

what I wanted to see is where this is called, since you said in the fluid, is it in the onBlockNeighborChange?

  • Author

what I wanted to see is where this is called, since you said in the fluid, is it in the onBlockNeighborChange?

 

I dont get what you mean, I called createHeavenPortal in the onDeathUpdate method of the entity I made. It is supposed to work so that when I kill the entity it spawns this portal. Just like the enderdragon

Then that's not the case of block updating.

What you should do is make the portal when you put the fluid, this happens in onBlockAdded event of the fluid's class, simply override it, remember to keep the super call, since the block liquid uses it.

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.