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 <standing-on> element to the Filters module #664

Closed
harvanchik opened this issue Sep 30, 2020 · 3 comments · Fixed by #671
Closed

Add <standing-on> element to the Filters module #664

harvanchik opened this issue Sep 30, 2020 · 3 comments · Fixed by #671
Labels
feature New feature or request

Comments

@harvanchik
Copy link

Feature Explanation

Sometimes, you want to know if a player is standing on a certain block, but you don't want to make 10, 20 or even more regions for all the places where that block/material is. Adding a <standing-on> element to the Filters module would make this so much easier.

Use Case & Implementation

A possible use case using this feature would be to kill a player when standing on a specific block. Instead of creating regions all around the map for every single occurance of the "kill block," the <standing-on> in the filter would do all the work for you.

<filters>
    <standing-on id="on-stone">
        <material>stone</material>
    </standing-on>
</filters>

Then apply a kit everywhere (or wherever this should take affect) to set their health to zero.

Whether or not it is implemented as an element like <standing-on> or another way, it would be nice to have a way of detecting this. In addition to <standing-on> it would make sense to add a <standing-beneath> (or under) -- and possibly a way of detecting blocks to the right, left, in front, and behind (or synthesize that into a <touching> element.

I'm not sure that adding them as elements is the best way of doing it, but I'll leave that up to the more experienced to decide.

Streamlining

I also wonder if it would be possible to streamline it so that you could also check for things such as if a player is placing a block that is above or below another block/material.

@Pablete1234
Copy link
Member

Pablete1234 commented Oct 1, 2020

I'd approach it as an offset filter modifier.

<filters>
    <offset loc="~0,~-0.5,~0">
        <material>stone</material>
    </offset>
<filters>

This would allow you to check if a player is next to a block, standing on a block, under a block, has certain block at y=0, or even looking at a block if ^ relative modifier is implemented. This is assuming vanilla coordinates where a number means absolute, ~ is for relative and ^ is relative to where you're looking at.

@harvanchik
Copy link
Author

@Pablete1234 This is much more streamlined. Would create so many possibilities for map makers.

@Pablete1234 Pablete1234 added the feature New feature or request label Oct 2, 2020
@KingOfSquares
Copy link
Contributor

I just completed this, had to run but PR is coming later today

@Electroid Electroid changed the title Feature Request: Add <standing-on> element to the Filters module Add <standing-on> element to the Filters module Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants