#help needed

1 messages · Page 1 of 1 (latest)

empty oyster
#

this is wat i currently have, i want the chests to be regenerated like this, also any way to detect loot table of the generated loot?

    set {_random} to a random integer between 20 and 64
    add {_random} of baked potato named <gold>MOULDY POTATO to the loot
    set {evx} to event-location's x-coordinate
    set {evy} to event-location's y-coordinate
    set {evz} to event-location's z-coordinate
    set {_random2} to a random integer between 60 and 128
    send "regenerating in {_random2} minutes"
    wait {_random2} minutes
    execute console command "/setblock {evx} {evy} {evz} minecraft:chest{LootTable:"minecraft:chests/dessert_pyramid"}"```
abstract herald
#

why are the coords not local vars

#

and skript will give the .5, minecraft wont want that

#

and you forgot quotes around the name

ebon lark
#

have you even run the code

#

i'm 99% certain that's going to return an error

empty oyster
#
on loot generate:
    set {_random} to a random integer between 20 and 64
    add {_random} of baked potato named "<gold>MOULDY POTATOES" to the loot
    set {evx} to event-location's x-coordinate
    set {evy} to event-location's y-coordinate
    set {evz} to event-location's z-coordinate
    set {random2} to a random integer between 60 and 190
    send "regenerating in {random2} minutes"
    wait {random2} minutes
    execute console command "/setblock {evx} {evy} {evz} minecraft:chest{LootTable:""minecraft:chests/dessert_pyramid""}"```

this is the code now
ebon lark
#

yeah im still just as certain it errors

abstract herald
empty oyster
#
    set {_random} to a random integer between 20 and 64
    add {_random} of baked potato named "<gold>MOULDY POTATOES" to the loot
    set {evx} to event-location's x-coordinate
    set {evy} to event-location's y-coordinate
    set {evz} to event-location's z-coordinate
    send "%{evx}% %{evy}% %{evz}%"
    set {random2} to a random integer between 60 and 190
    send "regenerating in %{random2}% minutes"
    wait 5 seconds
#   wait %{random2}% minutes
    set {_command} to "/setblock %{evx}% %{evy}% %{evz}% minecraft:chest{LootTable:'minecraft:chests/desert_pyramid'}"
    send {_command}
    execute console command {_command}```

got this now, the values return .5 but i can round them so thats fine
real vector
#

Set {list::*} to inventory of block at location x y z

#

Idk that might work

abstract herald
#

You still haven’t applied the local vars

#

Heck, you dont even need them, could plunk the expression into the command

#

And your broadcast is inaccurate as you wait another 5s

empty oyster
#

is tabnine speaking facts?

empty oyster
empty oyster
#

tabnine speaking facts?

abstract herald
#

you only have one event, so it doesnt matter

empty oyster
#

i have a problem: this code sends the command correctly but does not execute it correctly

#

i did it

#

it was /execute in %event-world% run ...

abstract herald
empty oyster
#

no

#

i set it to console command before

#

but its alr now

#

how can i fix this?

#

thanks for all help btw

abstract herald
#

Skript doesnt understand that

#

Youll have to stringify it then parse as timespan

empty oyster
#

how?

#

and is this right?

abstract herald
#

AI sucks at skript

abstract herald
#

then just parsed as timespan

empty oyster
#

doesnt really work

#

@abstract herald (sorry for pinging)

abstract herald
#

No no, you need the whole thibg

#

”%{x}% hours” parsed as timespan

empty oyster
#

same error with this

abstract herald
#

because now youre waiting (random 2 min) min

#

remove the second min, or just strinigfy and parse in that line

empty oyster
#

it works now

#

thank you very much

#

i need to make an item unusable in a crafting table and un renamable or usable in an anvil or grindstone

#

how can i do that?

abstract herald
#

on anvil prepare and cancel i guess

empty oyster
#

hold on imma send something

#
    if inventory opend is an anvil:
        
on inventory_click:
    if (inventory clicked is an anvil and item clicked is named "uncraftable"):
        cancel the event
    
on inventory_click:
    if (inventory clicked is an grindstone and item clicked is named "uncraftable"):
        cancel the event
        
on inventory_click:
    if (inventory clicked is an crafting table and item clicked is named "uncraftable"):
        cancel the event```
#

@abstract herald (sorry for ping)

abstract herald
#

you can combine those events

#

and i would just check the type of event-inventory

empty oyster
#

so this would work?

abstract herald
empty oyster
#

so you dont mind

abstract herald
empty oyster
#

this gives an condidtion error @abstract herald

abstract herald
#

yeah, you need one condition per line

abstract herald
empty oyster
empty oyster
#

ping me too

abstract herald
#
  if any:
    type of block at player = dirt
    type of block at player = diamond ore
  then:
    if name of player's tool = "no death":
      cancel event```
empty oyster
#

and in my case? @abstract herald

empty oyster
abstract herald
#

the type of event-inv is its type

#

like crafting table

#

or anvil

#

or chest

empty oyster
#

so

     if type of event-inv is crafting table:
              cancel event```
#

its not complete

empty oyster
abstract herald
#

(entory)

#

But that would work

#

You just need to check for the others as well

empty oyster
#

is that elif then?

abstract herald
#

Or an if any

empty oyster
abstract herald
#

The red lines? Or errors when it parses?

empty oyster
#

no if i reload the skript

abstract herald
#

Pretty sure you dont want the a/an

#

And you need the then

empty oyster
#

more errors

empty oyster
abstract herald
#

you can fix the indentation errors yourself

you dont need the then after the if, just the if any

you removed the a/an but now have a double spac

event-item's name is ...

empty oyster
#

if any doesnt work @abstract herald

#

it gives doesnt understand condition: any error

abstract herald
#

well

#

if youre checking the name you have to compare it to a string

abstract herald
empty oyster
abstract herald
#

well now youre not checking the name

#

so you dont need the quotes

empty oyster
#

it doesnt work too without quotes

abstract herald
#

broadcast the type

empty oyster
#

how?

#

nevermind

#

@abstract herald now it does cancel if its in the crafting table but not if you put it from your inventory to the crafting table

#

because it broadcasts player-inventory

abstract herald
#

your first condition fails

#

because there is no item, its an empty slot

#

check the cursor slot

empty oyster
#

no its because if you put it from your inventory to the crafting table, you click the inventory

#

@abstract herald

abstract herald
#

yes

empty oyster
#

how can i fix this

abstract herald
empty oyster
#

it has to detect if you put it in the crafting table

abstract herald
empty oyster
#

how do i check it

#

how do i program that then?

#

like if the slot where it was is empty now ?

#

it still has to be usable in smithing table

abstract herald
empty oyster
#

so can you show me an example

abstract herald
#
  type of event-inventory = chest
  player's cursor slot is 10 of diamond
  cancel event
  send "You cannot place 10 diamonds in a chest!" to player```
empty oyster
abstract herald
#

with the condition you already have

#

please turn off reply pings

empty oyster
#

why? they are intentional

#

like you said

#

ow

#

i misread your message sorry

#

i thought you said im gonna ignore this post if you dont ping me

#

sorry really

#

how do i do this

real vector
#

Any item named “…”

abstract herald
#

or just the name.... as you had earlier....

empty oyster
#

doesnt work

#

wait

#

i have this

#

it gives no error but doesnt work

abstract herald
#

name of ... = ...

empty oyster
#

no errors but still doesnt detect placing the item in the crafting table

#

ow it works but not with shift click

#

how do i do this

abstract herald
#

its still on onventory click

#

and check the click type

#

if you have a how question, first step is always to readthedocs

empty oyster
#

i did

#

im not that lazy

#

and not wasting your time without reasons

#

how do i do it for dragging

abstract herald
#

for some reason it doesnt list the possibilities

#

broadcast it to find out

empty oyster
#

i have it but it only includes right click dragging

#

how can i do if player has item

#

@abstract herald

abstract herald
#

if their inventory contains it? if its their tool?

gray sparrow
#

iirc using AI to make skript code is against the rules here.
So instead, I highly suggest you do your own research and use the tutorials located at https://www.skunity.com/tutorials, or use the ones created by Sovdee at https://sovdee.gitbook.io/skript-tutorials/, and reading the documentation at:

Or, use the forums at SkUnity and seeing if someone already answered your question: https://forums.skunity.com

empty oyster
#

Does the wait X minutes continue after server restart?

gray sparrow
#

yes, but only if it's a every x minutes event instead.

#

so instead of this: command test: trigger: send "hi" wait 1 minutes say "hello"
When the server restarts, "hello" will never be sent. So, something like this would be better: every x minutes: do something
Or if you still need a delay like that, Sovdee and others have tutorials on what's called "cooldowns" which may be similar to what you need

empty oyster
#
    set {_random} to a random integer between 20 and 64
    chance of 15%:
        add 1 netherite armor smithing template named "<gold>Undupable Upgrading template" to the loot
    add {_random} of baked potato named "<gold>MOULDY POTATOES" to the loot
    set {evx} to event-location's x-coordinate
    set {evy} to event-location's y-coordinate
    set {evz} to event-location's z-coordinate
    set {evx} to round down {evx}
    set {evy} to round down {evy}
    set {evz} to round down {evz}
   # send "<red>%{evx}% %{evy}% %{evz}%"
    set {random2} to a random integer between 60 and 190
    send "<green>regenerating in %{random2}% minutes"
    set {random2} to "%{random2}% minutes" parsed as timespan
    set {_command} to "/execute in %event-world% run setblock %{evx}% %{evy}% %{evz}% minecraft:chest{LootTable:'minecraft:chests/desert_pyramid'} destroy"
    wait {random2}
    execute console command "%{_command}%"
    wait 1 second
    execute console command "execute in %event-world% positioned %{evx}% %{evy}% %{evz}% run kill @e[type=item,distance=..10]"```
#

this is my skript

#

what i want is that the wait 60-190 minutes continues to count down after restart

#

so it doesnt stop regenerating chests

strange nebula
#

Is on loot generate an event? I have never seen that befor

empty oyster
#

If you open a loot chest it triggers

#

What can I do about "location is not loaded"

#

Like if I execute /setblock if no one is onlinr

empty oyster
#

i fixed it because i use empty server stopper i just let a force regenerate execute after 3 minutes of no players online

#

and i used /forceload

gray sparrow
#

I believe there is also an effect to load a chunk using Skript at a specific coordinate or chunk; may require an addon, I honestly don't remember. that way, no need to use commands like forceload

abstract herald
#

and again, a bunch of those can be local

empty oyster
#

forceload is more efficient, and easy

ebon lark
#

(its skbee)