Jump to content

Skript Veinminer


Fusezion

Recommended Posts

So I've noticed I haven't posted on forums since december of last year with my backpack skript which had plenty of positive feedback
during my time of making that I was also working on a skript 2.5.1 veinminer skript but wasn't too proud of it due to lag causes by large loops and the fact I basically never use commands so using that system I did with a command looks bad so I've spent a bit today reverting back to it's original form of only using ores

Currently it works with coal ore, iron ore, lapis ore, redstone ore, gold ore, quartz ore, emerald ore and diamond ore I wished it worked with nether gold ore however skript still doesn't seem to count it in the any ore expression

The skript should be just vanilla skript I don't believe there's any addon usages in this so please let me know what you think or what else I should make all feedback and suggestions help a lot

 

options:
	minimal_blocks_mine: 0

function veinMiner(p: player, loc: location, block: item):
	if {_p} is sneaking:
		metadata "veinminer" of {_p} is set
		loop all blocks in radius 1.43 around {_loc}:
			loop-block's location is not {_loc}
			loop-block is {_block}
			give {_p} (drops of loop-block using {_p}'s tool)
			set loop-block to air
			damage {_p}'s tool by 1
			if metadata "veinminer" of {_p} >= 25:
				wait 1 tick
			if metadata "veinminer" of {_p} is set:
				set metadata "veinminer" of {_p} to (metadata "veinminer" of {_p})+ 1
			if {_p}'s tool's durability >= {_p}'s tool's maximum durability:
				clear metadata "veinminer" of {_p}
				stop
			else if {@minimal_blocks_mine} < 1:
				veinMiner({_p}, loop-block's location, {_block})
			else if (metadata "veinminer" of {_p}) >= {@minimal_blocks_mine}:
				clear metadata "veinminer" of {_p}
				stop
			else:
				veinMiner({_p}, loop-block's location, {_block})
	else:
		clear metadata "veinminer" of {_p}

on mine of any ore:
	player is sneaking
	set metadata "veinminer" of player to 1
	veinMiner(player, event-location, event-block)

 

Note: I am aware of the issue of it giving double ores at times but there wasn't anything I could do about it since it's an issue with loop blocks

I'm a guy yes but I am also human just like any female so why do you believe it's so wrong to cry too?

Link to comment
Share on other sites

  • 1 month later...

Hello BomberBoy213

Please make sure that you aren't responding to posts that haven't been responded to in over a month. You can start a new thread in case you need some help. Thanks for understanding.
 

Link to comment
Share on other sites

  • pAxiee locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...