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
Causing player selector in Minecraft command #874
Comments
I can look into writing API and implementation if the Sponge developers think it would be worthwhile. |
Is it possible to implement this in a plugin? |
An API that exposes Minecraft target resolution (for those new @x) would be great. However, since cause tracking is supported by Sponge, I think at least a cause target selector should be something built-in. |
@kenzierocks It is within the realm of possibility, but I'm curious how it would be handled from the API standpoint. I'd imagine it would still be a special |
I think on the API side, a new event or changing existing event might not be necessary. However, internal Sponge's resolution for player parameters (those that declared during command registration) can be changed to make use of this |
The SelectorResolver does that, but it has a ton of bugs that need fixing (I have an open PR for this). |
@nguyenquyhy I added support for that some time ago in SpongePowered/SpongeAPI#780, but it does use SelectorResolver, so it will be affected by any bugs in that (see kashike's comment). |
@JBYoshi it seems the PR you referenced is closed. Is it merged somewhere else in Sponge? |
It was rebased into the master branch in SpongePowered/SpongeAPI@3476052. |
I don't really get it. So how can I target causing player now? E.g. a player clicks a button on a command block and how can the command block do |
I meant that added support for custom selectors in commands. It does not add support for a cause selector. |
How would it works if there is a button and a complex redstone circuit with gate, ...? |
I too thought it wouldn't be possible at the start, then when the Sponge cause system was introduced I was pleasantly surprised. At this stage it's just creating a selector that responds to causes, the cause system already exists, and works. |
Yes that is why I give the suggestion. It seems to me that Sponge already has all neccessary facility to implement a cause selector (Selector resolver + Cause tracking). @c can become a new built-in selector for all commands that use selector resolver. |
@advancid since the feature relies on cause tracker, it will have all limitation/ability of cause tracker. I agree that this feature may not work accurately in complex redstone mechanics when the cause is not obvious. However, I think for most of the cases, the cause of an activation is quite obvious, and the lack of cause selector force server owner to employ complex mechanism to make sure they target the correct player. Moreover, with plugins, there is also fewer needs for server owners to build complex redstone mechanics for complex functions. |
The only thing I don't necessarily agree with is using the prefix @ for Sponge-custom selectors, as it's plausible that minecraft introducing additional selectors would also use the @ prefix. It's a minor gripe, but I could see it being a future migration pain point if |
Would it be too much of a pain to use |
For me, |
Sponge is "A community-driven open source Minecraft modding platform.", I don't think this should be imlemented in Sponge it self but maybe in a plugin. |
I believe Sponge already has all facility to implement the function. In my opinion, having a another plugin just to merge two built-in Sponge functions feel a bit overkill. |
Is there any update on this? |
I also would be interested in seeing this added to Sponge by API 5. |
If this was implemented, I think it would not be in the API since it would make no sense, the API is for plugins. |
@advancid It might be a useful default for some commands. Example: |
Sorry to wake an old issue. Does anyone still want this? Sponge Causes have come a long way since this was submitted. Does anyone have a better idea of whether or not it is feasible? Or a better idea whether or not it belongs as a part of Sponge? |
Currently Minecraft supports several target selectors such as
@p
,@r
,@a
. I wonder if Sponge can add a new selector to target the cause of the command.For example, if I put a button on a command block, and set the command block to
/tp @c 100 100 100
, the command block will teleport the exact player that pressed the button. At the moment, the best I can do is to settp @p 100 100 100
, which is quite problematic in crowded area.If Sponge can really override the player target mechanism of Minecraft, the same
@c
may also be used with other plugins such as Command Sign.The text was updated successfully, but these errors were encountered: