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

Right now I am happily placing blocks with "setBlockState" but I ran into a small issue.

 

I would like to be able to place a monster spawner.

 

I have tried "Blocks.SPAWNER.getDefaultState()" but I don't have any control over what type of spawner.

 

How exactly would I place a spawner of a specific type?

Have you tried looking through the code, starting with SpawnerBlock?

 

Best guess, having not tried this myself, is that the TileEntity for the SpawnerBlock controls the spawning, so I'd start looking there. :)

I just opened SpawnerBlock, and the createTileEntity() method returns a new MobSpawnerTileEntity, so following into that class, I see there's a private AbstractSpawner field called spawnerLogic, so I'd probably go there next (as well as scan the rest of the code in the tile entity just to see if there's anything useful). . .you see what I mean. :)

 

Find something that looks promising, attempt to implement it, then come back here if it doesn't work, post a link to your code (having a github repo is the best way to share your code, and you likely will get more help having one, since it's easier to search through/clone/debug/etc) and also your debug.log (posting as a github gist is probably the best way, again with a link to here).

  • Author

Thank you! I have poked around the vanilla code a bit but wasn't exactly sure what I was looking for in this case. I'll take a look at that class and then go from there. :)

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.