Szernex Posted August 26, 2015 Posted August 26, 2015 Disclaimer: So far I've only written small utility mods so I have 0 experience in working with entities, blocks and such, so please bear with me... Basically my goal is to make something like Glowing Orbs that can be thrown like snowballs (that part is already working) and on impact they drop a block or something that has the following properties: - It emits light once it sits still; achieved by just giving it a lightLevel - It's affected by gravity like sand or gravel is; achieved by making the block extend BlockFalling - Now here's the catch: I want to make it so you can walk through it (done by overriding getCollisionBoundingBoxFromPool and returning null) but at the same time that other blocks that fall on it (be it my block or sand, gravel etc) don't get destroyed. I've looked at EntityFallingBlock and BlockFalling and all that but I just can't wrap my head around how I would solve that issue. So any help as to where to begin would be appreciated. Or if you have a different idea on how to approach this I'm all ears. I first tried to fiddle around with just entities that get dropped when the thrown Glowing Orb hits something but from what I understand you need blocks in order to emit light so... Quote
Choonster Posted August 26, 2015 Posted August 26, 2015 To allow falling blocks to collide with the block but other entities to pass through it, you need to override Block#addCollisionBoxesToList to only call the super method if the Entity is an instance of EntityFallingBlock . I have an example of this here. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Szernex Posted August 26, 2015 Author Posted August 26, 2015 Thanks, I actually just found that one too Quote
Recommended Posts
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.