#my mechanic isnt working

30 messages · Page 1 of 1 (latest)

clear garnetBOT
#

Once your question has been answered, please close this post with </resolve:1050379261372006400> command!

gentle raptor
#

use 3 backticks for codeblocks instead of just 1

#
like this
#

instead of ` code` use ``` code```

#

you can put js right after the first 3 to get syntax highlighting too

rocky fiber
#

your code doesnt really make sense

#

what are you trying to do?

#

right now your code should give you 4x planks, 3x cobble, 3x dirt, 2x raw iron, and 1 raw osmium if you click on a solid wall with an iron pickaxe

#

maybe this is more what you want

onEvent('block.left_click', event => {
    if (event.block.id != 'compactmachines:solid_wall') return

    event.player.give('oak_planks')

    if (event.item.id == 'minecraft:wooden_pickaxe') {
        event.player.give('cobblestone')
        event.player.give('dirt')
    }

    if (event.item.id == 'minecraft:stone_pickaxe') {
        event.player.give('cobblestone')
        event.player.give('dirt')
        event.player.give('raw_iron')
    }

    if (event.item.id == 'minecraft:iron_pickaxe') {
        event.player.give('cobblestone')
        event.player.give('dirt')
        event.player.give('raw_iron')
        event.player.give('mekanism:raw_osmium')
    }
})
#

gimme a min

#

maybe this might do the trick

#
onEvent('block.left_click', e => {
    if (e.block.id != 'compactmachines:solid_wall' || e.player.tags.contains('cm_cooldown')) return

    e.player.tags.add('cm_cooldown')
    e.server.scheduleInTicks(600, event => event.player.tags.remove('cm_cooldown'))
    e.player.give('oak_planks')

    if (e.item.id == 'minecraft:wooden_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
    }

    if (e.item.id == 'minecraft:stone_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
        e.player.give('raw_iron')
    }

    if (e.item.id == 'minecraft:iron_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
        e.player.give('raw_iron')
        e.player.give('mekanism:raw_osmium')
    }
})
#

600 ticks = 30 seconds

#

see if it works PinkYAYA

#

hold on

#

use this and after trying it out send me your server.txt please

onEvent('block.left_click', e => {
    if (e.block.id != 'compactmachines:solid_wall' || e.player.tags.contains('cm_cooldown')) return

    e.player.tags.add('cm_cooldown')
    console.log('test1')
    e.server.scheduleInTicks(600, event => {
        console.log('test')
        event.player.tags.remove('cm_cooldown')
    })
    e.player.give('oak_planks')

    if (e.item.id == 'minecraft:wooden_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
    }

    if (e.item.id == 'minecraft:stone_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
        e.player.give('raw_iron')
    }

    if (e.item.id == 'minecraft:iron_pickaxe') {
        e.player.give('cobblestone')
        e.player.give('dirt')
        e.player.give('raw_iron')
        e.player.give('mekanism:raw_osmium')
    }
})
undone moatBOT
#

Paste version of server.txt from @viral olive

rocky fiber
#

where?

#

i have no errors about missing brackets in my editor

#

are you sure you copied it correctly

#

send me your script file, somethings broken there

undone moatBOT
#

Paste version of script.js from @viral olive

rocky fiber
#

if its a modified script since last time you send the logs, i need to see the new logs again

undone moatBOT
#

Paste version of server.txt from @viral olive

rocky fiber
#

ah shit, your player still has the tag added and not removed

#

add this to your file temporarily, it will allow you to manually remove the cooldown tag when you rightclick with an item in your hand

onEvent('item.right_click', e => {
    e.player.tags.remove('cm_cooldown')
})
#

since the previous script added the tag but never removed it, your char basically has an infinite cooldown now

#

ah nice

#

then ou can remove that temporary event and the 2 console.log lines

clear garnetBOT
#

@weak garden Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!