1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mining 3x3, 3x4 and 3x5

Discussion in 'Skript' started by Mattllama987, Dec 26, 2019.

  1. Mattllama987

    Mattllama987 Well-Known Member

    Joined:
    Aug 5, 2018
    Messages:
    73
    Likes Received:
    0
    Hello, im making a custom enchantment that will mine a 3x3, 3x4 and 3x5 area. The 3x3 works fine, but the 3x4 is acting a little goofy. When i mine, it will break the block below the event-block, but it wont mine the top blocks next to the event block. Ill post a gif on what it does.
    GIF:
    https://gyazo.com/9ea4f8ecaff27d1a94b8d83fa51105e9

    Skript version:
    2.4.1

    Server Version:
    1.14.4 Paper Spigot

    Code:
    Code (Text):
    1. on mine:
    2.     set {_lore::*} to lore of player's tool
    3.     loop {_lore::*}:
    4.         if "%loop-value%" contains "&bDrill 1":
    5.             set {_location} to location of event-block
    6.             remove 1 from y coord of {_location}
    7.             loop all blocks around {_location} in radius 1.8:
    8.                 if loop-block is not bedrock:
    9.                     give player loop-blocks
    10.                     set loop-block to air
    11.         else if "%loop-value%" contains "&bDrill 2":
    12.             set {_location} to location of event-block
    13.             remove 2 from y coord of {_location}
    14.             loop all blocks around {_location} in radius 1.8:
    15.                 if loop-block is not bedrock:
    16.                     give player loop-blocks
    17.                     set loop-block to air
    Thanks!
    ~Matt
     
  2. krainser

    krainser Member

    Joined:
    Jan 27, 2017
    Messages:
    51
    Likes Received:
    3
    Have you tried removin just one value of the Y-loc in the line 13? also, if this is for large server with bunch of people, you must replace the loop in line 3 with checking only 1 lore line, in order to avoid lag issues, xxoo!
     
  3. Mattllama987

    Mattllama987 Well-Known Member

    Joined:
    Aug 5, 2018
    Messages:
    73
    Likes Received:
    0
    I will fix the loop in line 3 that you said. But i messed around with a few numbers to get it right yeah. But i cant seem to get it just right lol.
     
  4. Farid

    Farid Well-Known Member

    Joined:
    Feb 5, 2017
    Messages:
    171
    Likes Received:
    11
    Check the player's pitch, to determine if they're looking at the x-axis or z-axis.
    loop from top left block thru the bottom right block from the player's perspective
    naturally, break loop-block
     
  5. Mattllama987

    Mattllama987 Well-Known Member

    Joined:
    Aug 5, 2018
    Messages:
    73
    Likes Received:
    0
    Sorry i haven't replied sooner. But ive tried a few different things, and its just not working how it should. Could you show me a example on how you would do it so i can get it to work? :emoji_slight_smile:
    --- Double Post Merged, Jan 9, 2020, Original Post Date: Jan 5, 2020 ---
    Bump
    --- Double Post Merged, Jan 12, 2020 ---
    Bump
     
Loading...