Modding a Block's Behavior

x3ro

Member
Contributor
GUI
I was if there currently is any way to modify the behavior of a block, more specifically "do something to the player when she touches the block". Cervator told me to look for uses of the "isPenetrable" method of "Block", but these seem to be scattered across the codebase, which would mean that I'd have to implement that behavior somewhere in the class that detects the collision (hell no x.x). Am I missing something, or is this simply something that hasn't been thought of yet? :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
That was sort of what I suspected - interactions with basic blocks might be sort of primitive at the moment, unless some of the fanct physics / TeraBullet stuff Immortius worked on has a hook for something like that. We might just never have needed a reaction to "touch" events other than "don't let the player go there"
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I have thought about it a little. What I would do is extend BulletCharacterMovementSystem so that it builds up a list of the individual blocks (or entities) being collided with during the movement, and then sends a bump event to them. Then the entity for the block can have a component/system combo to respond to that event.

See the TNT or Chest blocks for examples of linking a block with an entity/prefab.

Let me guess you're thinking... cactus damage? :p
 
Top