• 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!

winterwolf007

New Member
Feb 24, 2017
8
4
0
23
This is a tutorial for effects with blocks.

We will now start with a radius from the location of a block. This code loops entities in a radius of 5 around the block's position.

code_language.skript:
loop all entities in radius 5 around blocks's location:

Now we will add an event for in which this loop will occur. For example, I will be using On Place as the event

code_language.skript:
on place:
    loop all entities in radius 5 around block's location:

Now, we will add an effect to the loop. Some effects can only be used for some things like blocks or entities.

code_language.skript:
on place:
    loop all entities in radius 5 around block's location:
        teleport loop-entity to block
Now, when we place a block, it will loop all entities in a radius of 5, and teleport them to the block. But we want only dropped items, not animals or monsters. We can define 'loop-entity' by adding a condition.

code_language.skript:
on place:
   loop all entities in radius 5 around block's location
        if loop-entity is a dropped item:
             teleport loop-entity to block

This makes it so when you place some block like sandstone, it teleports all dropped items in a radius of 5 blocks to the location of the block you placed

You can also change the event to be more specific, like instead of on place (of any block), we can change it to on place of sandstone.

code_language.skript:
on place of sandstone:
    loop all entities in radius 5 around block's location:
        if loop-entity is a dropped item:
             teleport loop-entity to block

This makes it so when you place a sandstone block, it loops all dropped items around it (radius of 5 blocks) and teleports it to the sandstone block.

Now, we want it to keep on doing this process over and over again. We can add loops and a wait time to make this process repeat.

code_language.skript:
on place of sandstone:
  loop all entities in radius 5 around block's location:
       loop 10 times:
           wait 1 second
           if loop-entity is a dropped item:
                teleport loop-entity to block

This makes it so when you place a sandstone block, it loops all dropped items in a radius of 5 blocks, then it waits one second and teleports the dropped item to the block. This process repeats 10 times, caused by the
'loop 10 times'



That's it for the tutorial, if you have any questions, please feel free to message me.
 
Last edited:
The tutorial I am giving you guys on is in the title. . This is just an example of what it can do. And this tutorial can be used for beginners and intermediate skripters. 'Another man's trash is another man's treasure'
This skript's usefulness can be viewed in different ways. If you make a ton of advanced tutorials, then the beginner skripters don't know how to use the tutorial because it is too advanced for them. There has to be some tutorials for newer skripters. And parts of the tutorial can be used, looping in radius of a block can be changed into player or whatever. The teleportation of entities can be used for magnet skripts or anything else like a clear lag skript.
 
The tutorial I am giving you guys on is in the title. . This is just an example of what it can do. And this tutorial can be used for beginners and intermediate skripters. 'Another man's trash is another man's treasure'
This skript's usefulness can be viewed in different ways. If you make a ton of advanced tutorials, then the beginner skripters don't know how to use the tutorial because it is too advanced for them. There has to be some tutorials for newer skripters. And parts of the tutorial can be used, looping in radius of a block can be changed into player or whatever. The teleportation of entities can be used for magnet skripts or anything else like a clear lag skript.
Another's man trash is another man's treasure doesn't apply here since we aren't talking material; this is completely 100% useless as all of this can be found on the docs in less than 10 seconds, and it's self explaining code, honestly the tutorial stuff is meant to give people tutorials on certain objects, if you want to do a tutorial on loops, make sure to go from basic basic to very advanced, or it's useless.
 
It can apply if it is in the 3rd person. Anyways, I made this tutorial for newer skripters, It can be used for different things, as told above.
 
It is a useful tutorial, I mean I don't see the point on belittling the guy for a half decent tutorial on using the "On Place" event, this is great for people who are just getting started.

Great tutorial @winterwolf007 :emoji_slight_smile: