I'm trying to create a block that looks like a Gold block (i.e. it stands out from a long distance and is easy to see) but that players can walk through. I did some digging around all the existing Blocks and thought I was on the right track taking properties from Blocks like 'Carrot' (a Crop) that you can walk on top of, combined with a subclass of block\Gold to give the look and feel of gold. Also tried setting some other properties that seemed relevant, so my code looks like this: PHP: use pocketmine\block\Gold;class RegionMarker extends Gold { protected $id = 1000000; public function __construct() { parent::__construct(); $this->boundingBox = null; } public function isTransparent(){ return true; } public function isSolid(){ return false; } public function getBoundingBox(){ return null; }} I've discovered that fiddling with the value of $id causes the block to look and behave completely differently - I've tried various values. However, I can't make a Gold block that can be walked through. Can anyone shine some light on the secrets of how to extend a Block to alter it?
Yes PocketMine thinks it's transparent, but clients won't because the transparency won't be sent to the client.
Yes, those flags are for the server to correctly handle player movements, and prevent illegal moves (hacks xD) but anyways, you can spawn a "FallingSand" entity with the Gold Block behaviour check out how sand works and I believe that it will only need a change of ID xD
Ah, thanks both, that's great, I'll give falling sand a try. Yes, thinking about it, I should have realised there are client-side implications to making your own blocks, doh!