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!
LOOKING FOR A VERSION OF SKRIPT?
You can always check out skUnity Downloads for downloads and any other information about Skript!
So basically what i want is if a player has fortune to their pickaxe/axe then they get so and so amount depending on how much fortune and also if i could add a name to the material given to the player such as &b&lDark Diamonds here is the code if anyone could help
on break of diamond block:
if gamemode of player is survival:
if event-block is cobblestone:
give player diamond 5
clear drops
You should try coding it yourself first, and if you encounter any problems thats where you should ask for help in this forum, rather than people spoon feeding you the code. Also there's a button to place your "code"(script) so that it would look clean the next time you post a script in a forum
You should try coding it yourself first, and if you encounter any problems thats where you should ask for help in this forum, rather than people spoon feeding you the code. Also there's a button to place your "code"(script) so that it would look clean the next time you post a script in a forum
okay, i will try but im very new and i don't even know where to start to coding it, i asked someone already and they gave me a solution already so i might just delete this post but thanks for showing me the "code" thing. i appriciate it
So basically what i want is if a player has fortune to their pickaxe/axe then they get so and so amount depending on how much fortune and also if i could add a name to the material given to the player such as &b&lDark Diamonds here is the code if anyone could help
on break of diamond block:
if gamemode of player is survival:
if event-block is cobblestone:
give player diamond 5
clear drops
Additional enchant functionality can be tricky to code with Skript but is very much doable. If you want a true fortune enchant type effect applied to a certain block, you'll likely need to do a bit of math. Minecraft's true fortune has a bit of complex math, so for the sake of this, I'll make it simplier. You start with an RNG, this will be the max amount of blocks a player can get:
Code:
set {_rb} to a random number between 1 and 4
After that, apply a chance percent to give that number of drops to player
Code:
set {_rb} to 1
chance of 28%:
set {_rb} to a random number between 1 and 4
Notice I set {_rb} to 1 before the RNG code is called that way even if it doesn't occur, {_rb} will still be set and usable. Now, after that, you apply the other events to correspond with the code and slight customization to the given item.
Code:
on break of cobblestone:
player's gamemode is survival
player's tool is enchanted with fortune
set {_rb} to 1
chance of 28%:
set {_rb} to a random number between 1 and 4
give {_rb} of diamond named "&b&lDark Diamond" to player
Additional enchant functionality can be tricky to code with Skript but is very much doable. If you want a true fortune enchant type effect applied to a certain block, you'll likely need to do a bit of math. Minecraft's true fortune has a bit of complex math, so for the sake of this, I'll make it simplier. You start with an RNG, this will be the max amount of blocks a player can get:
Code:
set {_rb} to a random number between 1 and 4
After that, apply a chance percent to give that number of drops to player
Code:
set {_rb} to 1
chance of 28%:
set {_rb} to a random number between 1 and 4
Notice I set {_rb} to 1 before the RNG code is called that way even if it doesn't occur, {_rb} will still be set and usable. Now, after that, you apply the other events to correspond with the code and slight customization to the given item.
Code:
on break of cobblestone:
player's gamemode is survival
player's tool is enchanted with fortune
set {_rb} to 1
chance of 28%:
set {_rb} to a random number between 1 and 4
give {_rb} of diamond named "&b&lDark Diamond" to player
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.