#How to make automine+autosmelt skript more efficient

1 messages · Page 1 of 1 (latest)

tough halo
#

Any of yall know how to make this skript better? I fear it will cause lag

    if block is iron ore:
        cancel drops of items
        give player 1 iron ingot
        
on mine:
    if block is gold ore:
        cancel drops of items
        give player 1 golden ingot

on mine:
    if block is coal ore:
        cancel drops of items
        give player 1 coal
        
on mine:
    if block is diamond ore:
        cancel drops of items
        give player 1 diamond
        
on mine:
    if block is hay:
        cancel drops of items
        give player 1 hay
        
on mine:
    if block is stone:
        cancel drops of items
        give player 1 cobblestone

on mine:
    if block is snow block:
        cancel drops of items
        give player 1 snow block```
unkempt helm
#

i think you can just do this

#

let me show you an example

    if block is (block):
        cancel drops of items
        give player 1 iron ingot
    else if block is (block):
        cancel drops of items
        give player 1 iron ingot```
#

something like that should work

#

or to make it even better you could make every block mined cancel drops

#
    cancel drops of items
    if block is (block):
        give player 1 item
    else if block is (block):
        give player 1 item```
#

makes it way easier and contains less lines as of a result

dense mantle
#

no this is bad

unkempt helm
#

i'm new to using skript so i wouldnt know any methods for this, if you are going to say this was bad then youcould provide some insight too

analog carbon
#
    set {_block} to event-block
    set {_item} to ""
    
    if {_block} is "IRON_ORE":
        set {_item} to "IRON_INGOT"
    else if {_block} is "GOLD_ORE":
        set {_item} to "GOLD_INGOT"
    else if {_block} is "COAL_ORE":
        set {_item} to "COAL"
    else if {_block} is "DIAMOND_ORE":
        set {_item} to "DIAMOND"
    else if {_block} is "HAY_BLOCK":
        set {_item} to "HAY"
    else if {_block} is "STONE":
        set {_item} to "COBBLESTONE"
    else if {_block} is "SNOW_BLOCK":
        set {_item} to "SNOW_BLOCK"
    
    if {_item} is not "":
        cancel event
        give player 1 of {_item}```
unkempt helm
#

interesting

analog carbon
hearty lagoon
#

Yeah, looks like it

analog carbon
#

mhm

hearty lagoon
#

Aside from that we cancel the drops no matter what block it is

icy sonnet
#

Yay

dense mantle