1

Command (-Blocks) acts indeterministically

ChaosNe0's Avatar ChaosNe03/24/20 12:26 pm history
1 emeralds 147 4
3/26/2020 2:44 am
HoboMaggot's Avatar HoboMaggot
Hi there!

Context:
I launched my amateur's attempt of creating an adventure map and created a tower whose staircase is an impossible space. Just a quick explanation: The tower is separated in two parts: The base and the upper part (now referred to as "the tower"). Each of those parts have an upper and a lower part. When standing at the upper base, going down the staircase (there's no way up, down is the only way) leads to the lower tower and vice versa.

Now I wanted to create a mechanism that can deactivate this behaviour: There's a book on a lectern in which there is an on-click command-text which give the player an item which they have to carry. Was long as they do, the teleporters in the base and the tower are deactivated.

Here's a picture of how this works and what the commands are. (Please notice, that I haven't yet created the part that turn off the teleporters when the player carries the item. I only created the teleporters, the summoning of the book and the summoning of the item yet.)

How it should work

Here's the problem:
When holding the book, the summoning of the key works fine. When using the book on a lectern, the 2nd and 3rd command-block sometimes change their order of execution. (Or so it would seem, as I can see the animation of getting an item via /give but not having any item in my inventory.)

Are there any known bugs with the lectern? What can I do to avoid this bug?



Edit: Here's the zipped map, if you want to try it yourself. Melmquest.zip
Posted by ChaosNe0's Avatar
ChaosNe0
Level 1 : New Miner
1

Create an account or sign in to comment.

4

1
03/25/2020 11:54 am
Level 1 : New Miner
ChaosNe0
ChaosNe0's Avatar
I tested a bit more, but as this is taking up much too much time, I'd like ask for your help on this:

It appears there are two major bugs:
  1. If the book is in the lectern and there are keys in the inventory (not the toolbar), the on-click-action does not delete those keys.
  2. If the book is in the lectern and there are keys in world-space, the on-click-action gives the player an invisible key. (No icon in inventory)
To test this out I created a new, simple map: BUG.zip

Here's a screenshot:
Now, to recreate the bug, do this:

Recreate BUG #01:
  1. Spawn an armor stand
  2. Spawn a lectern
  3. Spawn a book, put it on the lectern
  4. Right-click the lectern, left-click the text "click me", you'll receive a key → This will now be referred to as "lectern-spawn a key"
  5. Put the key in you inventory (not the toolbar)
  6. Lectern-spawn a key, you'll have the new one in your toolbar and the old one still in your inventory → BUG #01
Recreate BUG #02:
  1. Spawn an armor stand
  2. Spawn a lectern
  3. Spawn a book, put it on the lectern
  4. Right-click the lectern, left-click the text "click me", you'll receive a key → This will now be referred to as "lectern-spawn a key"
  5. Throw the key in world space somewhere on the ground
  6. Lectern-spawn a key, the key in world space will be gone and one of the following will have happened:
    (a) the newly spawned key is in your toolbar and its icon is visible (normally happens the first 1-2 tries)
    (b) the newly spawned key is in your toolbar and its icon is invisible (happens on every consecutive try; can be reset by book-spawning a key)
(With "book-spawning a key" I mean to open the book while holding it in your toolbar/hand and spawning a key by clicking the action-text.)
1
03/24/2020 8:25 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
What are the commands of the 2 command blocks which change order?
1
03/25/2020 7:10 amhistory
Level 1 : New Miner
ChaosNe0
ChaosNe0's Avatar
You can see the commands in the image.

(2nd block) (d) clear @p tripwire_hook{display:{Name:"\"Spatial Key\""}}
(3rd block) (e) give @p tripwire_hook{display:{Name:"\"Spatial Key\"",Lore:["\"Dispells space-wrapping\"","\"illusions just by existing\"","\"in your pocket.\""]},Enchantments:[{id:"vanishing_curse",lvl:1}],Unbreakable:1,HideFlags:1}
Edit: Formatting
1
03/26/2020 2:44 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
I have no idea why the commands switch. They're both supposed to run as a chain.
Try making command block "e" conditional, so the previous has to get rid of the key before giving you the next one.
If that doesn't work you may need to resort to custom item tags
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome