Posted May 26, 20205 yr 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?
May 26, 20205 yr 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).
May 27, 20205 yr 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.