We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

3

A /range Command

1 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 1
    Registered User commented
    Comment actions Permalink

    This is already possible, using target selector arguments. You may know about r and rm selecting targets within a spherical radius, but if you are trying to make a rectangular selection box, you should learn the arguments dx, dy, and dz, which allow you to set up a rectangular prismic "selection box". When used, only entities within that box will be selected.

    How to Use

    You place these arguments in the square brackets of a target selector, just like all other arguments:

    @a[x=__,y=__,z=__,dx=__,dy=__,dz=__]

    The tricky part is knowing what values to fill in. You fill in dx, dy, and dz with the length, height, and depth of the selection box. For example, for 3 blocks long, 4 blocks high and 5 blocks deep, fill in 3 for dx, 4 for dy, and 5 for dz.

    For the x, y, and z arguments, fill those in with the coordinates of the lower northwest corner of the desired target area.

    Your examples

    Here are your examples in the correct form:

    effect @a[x=~,y=~,z=~,dx=9,dy=9,dz=9] jump_boost 1 1 true
    clear @a[name=afterlifepro794,x=20,y=60,z=20,dx=19,dy=0,dz=19]

    Target selector arguments are very useful for selecting targets in a certain range. This should solve your problem.