- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleEdit of P#49987 - merguFormatting
TypePlain Text
Date2018/09/21 14:55:19 UTC-07:00
ByBloodEko
OtherEdit of paste #49987 - click here to see edit details
Paste
            /////////////////////
            //   BLOCK ATTRIBUTES
            /////////////////

            // <--[tag]
            // @attribute <l@location.above>
            // @returns dLocation
            // @description
            // Returns the location one block above this location.
            // -->
            case "above": {
                return new dLocation(this.clone().add(0, 1, 0))
                        .getAttribute(attribute.fulfill(1));
            }

            // <--[tag]
            // @attribute <l@location.below>
            // @returns dLocation
            // @description
            // Returns the location one block below this location.
            // -->
            case "below": {
                return new dLocation(this.clone().add(0, -1, 0))
                        .getAttribute(attribute.fulfill(1));
            }

            // <--[tag]
            // @attribute <l@location.block>
            // @returns dLocation
            // @description
            // Returns the location of the block this location is on,
            // i.e. returns a location without decimals or direction.
            // -->
            case "block": {
                return new dLocation(getWorld(), getBlockX(), getBlockY(), getBlockZ())
                        .getAttribute(attribute.fulfill(1));
            }

            // <--[tag]
            // @attribute <l@location.center>
            // @returns dLocation
            // @description
            // Returns the location at the center of the block this location is on.
            // -->
            case "center": {
                return new dLocation(getWorld(), getBlockX() + 0.5, getBlockY() + 0.5, getBlockZ() + 0.5)
                        .getAttribute(attribute.fulfill(1));
            }



RawRaw



Pastes made: 54315