Jump to content

Custom Dispensers


LaDestitute

Recommended Posts

I've been working on having a custom dispenser-block in my mod and have came to the conclusion that I can't have dispensing-behavior without the block using a Dispenser as it's tile entity and having the dispensing-related code use the Dispenser TE in the block as a result, i.e in the dispense() method if I want it to be able to dispense items. This is maybe the only way it's doable in 1.12 for having custom Dispenser/Dropper blocks, since I've checked out the source code for a few mods that use custom dispenser-blocks and they do it the same way. Unless I'm missing something, is this the only way if I want a custom Dispenser-like block?

 

This complicates another issue as a direct result, I can't do EntitiesWithinAABB checks (specifically to auto-fire if an entity walks near the southface, preferably with ITickable) without attaching a custom tile entity and doing so/replacing all the Dispenser behavior with my own Dispenser-based TE breaks the dispensing itself.

 

My Block (don't mind the vanilla code, I'm just fiddling with stuff)

https://pastebin.com/gTvsVu8n

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.