mojira.dev
MC-64789

Tripwire changes value when an entity occupies the same block even if it's not connected to a hook

Steps to reproduce:

  • Place command block with this command

    /testforblock ~ ~1 ~ tripwire 0
  • Place string on top of command block

  • Notice value of string (tripwire) changes if you are standing on the block or not.

Attachments

Comments 11

This description is very confusing. From what I can tell, I tested this and there seems to be no difference between using testforblock and execute detect.

The commands I used were

/testforblock ~ ~ ~4 minecraft:tripwire 1

This gave a positive result while standing in the tripwire

/execute @p ~ ~ ~ detect ~ ~ ~ tripwire 1 say correct

This also gave a positive result

I think we will need screenshots and put your coding in code tags with curly brackets to clarify please

Ok, I'm sorry, I was wrong. I've missinterpreted it as I didn't looked at the coordinates I was using.

BUT what I actually discovered was that when typing in

/testforblock ~ ~ ~ minecraft:tripwire 0

while standing at 9, 101, 130 it returned "The block at 9,101,130 had the data value of 1 (expected 0).". (Image 1)
Now I go 1 block north, so I'm standing at 9, 101, 129 and entered

/textforblock ~ ~ ~1 minecraft:tripwire 1

and it returned "The block at 9,101,130 had the data value of 0 (expected 1).". (Image 2)

I have updated the description and title to correct it.

Aha I see now. Possibly works as intended as tripwires when being stepped on change value, but in this case you don't have it hooked up to any tripwire hooks. Okay to simplify this bug report, I'd suggest you change the title "String on ground changes value if player occupies same block"

In your description put this:

Steps to reproduce:

  • Place command block with this command

    /testforblock ~ ~1 ~ tripwire 0
  • Place string on top of command block

Notice value of string (tripwire) changes if you are in the standing on the block or not.

Ah. You're right that the tripwire changes its data value when an entity occupies the same block, so it works as intended. Apparently I was tired when I came across this and it confused me.
qmagnet, thank you for your pacience and helpfulness.

Can a mod please mark this as works as intended or just close it, if only Mojang can mark it as works as intended?

Well... I don't understand why the block changes value when you stand in it. Is this actually works as intended?

1 more comments

But this affects string that is not attached to hooks. I'd like to see if Mojang says this actually is WAI.

My guess is that it's computationally cheaper to decouple the entity check from the block/redstone updates in this way. The tripwire's powered state can toggle as rapidly as an entity enters or leaves its hitbox, without needing to check any other states or blocks, and the more expensive checks for other tripwire or hooks can happen at a slower pace, on the redstone update schedule.

The hooks give off the signal.

Cool for adventure maps? Invisible traps not requiring tripwire hooks as tripwire changes from value 0 to 1... :/

Berni U

Erik Broes

Community Consensus

data, data-value, datavalue, testforblock, value

Minecraft 14w31a, Minecraft 14w34d, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre6, Minecraft 1.8.3, Minecraft 1.8.4

Retrieved