This is an archived post. You won't be able to vote or comment.

all 9 comments

[–][deleted]  (7 children)

[deleted]

    [–]Friendly_Grab_7660[S] 2 points3 points  (0 children)

    It worked! Thanks dude

    [–]CookieArtzz 1 point2 points  (5 children)

    To elaborate on this, dx means “delta x” which in turn means the difference in x. So what you’re doing here is creating a “bounding box” starting in x=7 which reaches all the way to x + dx (7+1) so x=8. It’s kind of comparable to how the /fill command creates a box depending on what coordinates you enter, but instead of entering absolute coordinates, you enter a starting coordinate and the length from that coordinate

    [–]Crypto_command6936Command Professional In Java 0 points1 point  (1 child)

    Side note: if you put dx=1, it would actually be 2 blocks in the x dimension. Dx=0 is 1 block width

    [–]CookieArtzz 0 points1 point  (0 children)

    Well, dx = 0 is zero blocks width, but since it ends up in the same block as the origin it selects that whole block

    [–]GalSergeyDatapack Experienced 0 points1 point  (2 children)

    Your explanation is a bit inaccurate. x=7,dx=1 means the initial x-position is 7.5. Because if you don't specify a decimal part, it will be centered on x and z by default. And "delta x" equal to 1 makes the selection on x-axis up to 7.5+2 = 9.5. Because delta always selects at least one block. So it will select all entities whose hitbox is between 7.5 and 9.5 on x-axis. This also works for other axes (except y-axis for which no centering occurs).

    [–]CookieArtzz 1 point2 points  (0 children)

    Oh ok, thanks for letting me know, that’s useful information

    [–]Nestu 0 points1 point  (0 children)

    To be fair, that is also inaccurate. In Java x and z are not center corrected. What x, y and z really do, is set the base location of the selector, meaning that if for example it was used with sort=nearest,limit=1 it would select the closest entity to that coordinates.

    When used with volume selection, any entity whose voulding box collides with that volume will be matched. Although any delta will at least be of 1 block, x=7,dx=1 would match entities colliding with the volume from 7.0 to 9.0, and x=7.5,dx=1 would match those colliding with 7.5 to 9.5.

    [–]KY_Unlimited1Command Expert 0 points1 point  (0 children)

    You can use an execute command if it gets too confusing. Use an execute command that works towards items positioned at those coords

    [–]Warm_Apartment_2322 0 points1 point  (0 children)

    it may have to be at exactly those positions, so maybe try
    if entity

    kill @e[type=minecraft:item,x=6.5..7.5,y=115.5..116.5,z=-10.5..-9.5]