Skip to content

Issue with conditional cmd blocks when changing direction #35

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

Closed
GnaspGames opened this issue Jul 23, 2016 · 4 comments
Closed

Issue with conditional cmd blocks when changing direction #35

GnaspGames opened this issue Jul 23, 2016 · 4 comments
Labels
Milestone

Comments

@GnaspGames
Copy link
Owner

An issue has been noticed with how Smelt changes the direction of command blocks. When a command block is conditional, this breaks the conditional logic.

Example: http://i.imgur.com/PjQLZT7.png

Workaround: Users can insert their own blank commands to push the chain of blocks 'around the corner' before the conditional chain is placed. I would prefer it if Smelt could do something to 'fix' this scenario.

There is one known solution that I've tested, which involves inserting generated command blocks when the direction is changed, and the one before the conditional block then uses /blockdata to try and reset the SuccessCount of the previous command. This will fail if the previous command failed (is already 0) and will succeed if the previous command succeeded (it was 1, so we could reset to 0).

Example: http://imgur.com/a/0EqFk

There may be issues with this that need considering. Could this affect other commands or use cases?

It might be possible to also solve this using /stats block but that would require a custom entity and scoreboard objective as well. Which means that the map maker would HAVE to install a module into their world to allow for this type of fix (or the generated code would have to EACH TIME).

I'm going to think about this some more.

@GnaspGames
Copy link
Owner Author

I'm going to be using features from #12 to help fix this; so my focus is on that now.

@GnaspGames
Copy link
Owner Author

Skaran pointed out that the /testforblock command would be able to do something simular to /blockdata without resetting the SuccessCount.

testforblock ? ? ? minecraft:chain_command_block -1 {SuccessCount:1}

However, the correct command block type would have to be used,

In feature #12 I will hopefully be making it possible to know what the last command block coords and type are. This should make this possible.

GnaspGames added a commit that referenced this issue Aug 16, 2016
@GnaspGames
Copy link
Owner Author

Hopefully b876dea will fix this issue. I want to rewrite some code after this; but this will do for now.

@GnaspGames
Copy link
Owner Author

Closed with version 0.9.3

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

No branches or pull requests

1 participant