Jump to content

Fortune Skript Help


Zman2909

Recommended Posts

on block place:
    set {BlockByPlayer::%event-location%} to player

on block break:
	if {BlockByPlayer::%event-location%} is set:
		if player's tool is not enchanted with fortune:
			set {_drops::*} to drops of block with player's tool
			clear drops
			give player {_drops::*}
		else:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*}
	else:
		if player's tool is enchanted with fortune 1:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 2:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 3:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 4:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 5:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 6:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 7:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 8:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
		if player's tool is enchanted with fortune 9:
			set {_drops::*} to drops of block
			clear drops
			give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}

I'm new to skript and I just wanted to know if anyone is able to help me with this. I'm not asking to get it re-done for me I just want someone to help me out with it. I'm trying to make it so that when a player mines a block it goes into their inventory and gives them 1 more of the item per level of fortune but only if the block was not placed by a player. I also the item to be smelted if possible. I know this skript is made really poorly so I just wanted to ask if anyone was able to help me out with it.

Link to comment
Share on other sites

on block place:
	add location of event-block to {blocksbyplayer::*}

on block break:
	if {blocksbyplayer::*} contains location of event-block:
		stop
	else:
		clear drops
		if player's tool is enchanted with fortune 1:
			if event-block is iron ore or deepslate iron ore:
				give player 1 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 1 of gold ingot
			else:
				set {_drops::*} to drops of block
				give player {_drops::*}
		if player's tool is enchanted with fortune 2:
			if event-block is iron ore or deepslate iron ore:
				give player 2 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 2 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 2 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 3:
			if event-block is iron ore or deepslate iron ore:
				give player 3 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 3 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 3 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 4:
			if event-block is iron ore or deepslate iron ore:
				give player 4 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 4 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 4 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 5:
			if event-block is iron ore or deepslate iron ore:
				give player 5 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 5 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 5 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 6:
			if event-block is iron ore or deepslate iron ore:
				give player 6 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 6 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 6 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 7:
			if event-block is iron ore or deepslate iron ore:
				give player 7 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 7 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 7 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 8:
			if event-block is iron ore or deepslate iron ore:
				give player 8 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 8 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 8 times:
					give player {_drops::*}
		if player's tool is enchanted with fortune 9:
			if event-block is iron ore or deepslate iron ore:
				give player 9 of iron ingot
			else if event-block is gold ore or deepslate gold ore:
				give player 9 of gold ingot
			else:
				set {_drops::*} to drops of block
				loop 9 times:
					give player {_drops::*}

i created this...
it should work 🙂

                                                                        Skærmbillede 2024-02-11 151140.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...