Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add break attribute to Block Drops Rule #1073

Closed

Conversation

CoWinkKeyDinkInc
Copy link
Contributor

@CoWinkKeyDinkInc CoWinkKeyDinkInc commented Oct 9, 2022

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>

@Pablete1234
Copy link
Member

Pablete1234 commented Oct 10, 2022

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

@CoWinkKeyDinkInc
Copy link
Contributor Author

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.

@Pablete1234
Copy link
Member

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

@Pablete1234
Copy link
Member

Replaced by #1086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants