CC: Tweaked

CC: Tweaked

57M Downloads

Strange and inconsistent behavior with turtle.place() regarding minecarts

whizvox opened this issue ยท 1 comments

commented
  • Minecraft version: 1.15.2
  • CC: Tweaked version: 1.90.2
  • Detailed reproduction steps: Place a turtle -> Put a placeable block in the turtle's selected slot -> Put any variation of a minecart in front of it -> Attempt to do turtle.place()

The function call will return true, but the turtle will not place the block.

Other findings:

  • This bug occurs even if there's a rail underneath the minecart, which by itself returns false, as expected.
  • Certain, seemingly arbitrary, variations of minecart and player positions result in inconsistent behavior, even with the aforementioned bug in consideration.

2020-08-02_20 55 45
Returns false and "Cannot place block here"

2020-08-02_20 56 40
Returns true, no block placed

2020-08-02_21 04 01
Returns false and "Cannot place block here"

2020-08-02_21 10 22
Returns true, no block placed

2020-08-02_21 00 37
Returns true (with turtle.placeUp()), no block placed

commented

If an entity is in the line-of-sight of a turtle, turtle.place will attempt to interact with it first. This allows turtle.place to milk and breed cows1, etc...

What's happening here, is that the turtle is interacting with the minecart. However, minecarts can always be interacted with, so CC:T thinks it's done something and returns true. Sadly there's not much we can really do here - minecarts lie, and there's not much I can really do to avoid that.

In the cases it returns false, the minecart isn't in the line of sight, but it prevents the block from being placed - much like it would when a player does it. Thankfully CC:T does detect that case!

1: I believe anyway, been a while since I tested that.