PGM
PGM copied to clipboard
Add break attribute to Block Drops Rule
This PR adds a break attribute to the Block Drops Rules that allows better fine tuning of block drops and fixes an issue described in #835 where only affecting trampled blocks stopped working. You used to be able to add <cause>trample</cause> into the filter to do the same effect, but this doesn't work anymore as mentioned in #796 (the filter always returns deny).
<block-drops>
<!-- break defaults to true -->
<!-- any stone blocks stepped on by the player turns into dirt -->
<rule trample="true" break="false" region="everywhere">
<filter>
<all>
<material>stone</material>
<!-- <cause>trample</cause> stopped working -->
<any>
<sprinting/>
<walking/>
<crouching/>
</any>
</all>
</filter>
<!-- Replaces the affected block -->
<replacement>dirt</replacement>
<!-- Drop emerald ore when player steps on stone block -->
<drops>
<item material="emerald ore"/>
</drops>
</rule>
</block-drops>
This seems like a poor hack that won't actually solve anything. If i'm reading it correctly, setting break to false makes it so block transform event (breaking blocks) is ignored unless break is true. If the aim is to fix cause -> trample being broken, investigate the root issue
Trample does work, its just that it will also affect broken blocks too unless you add <cause>trample</cause> into the filter. I am guessing that the cause filter stopped working and that @CrazyisCreeps might have been mistaken thinking that trample is fully broken. This PR isn't a hack. Either way, adding this break attribute is a more cleaner solution to only changing blocks when trampled.
The solution to <cause>trample</cause> being broken, is to investigate that issue and fix it, rather than to add an extra flag that needs to be set to work-around the bug
Replaced by #1086