#client_scripts

75 messages · Page 1 of 1 (latest)

orchid jacinthBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

glossy berry
#

wouldnt it be better to add a tooltip instead hmmm

sly sphinx
#

no, you forgot to tell it what item to add it to

carmine anvil
#

it would also be event.add(linebanned, ['BANNED']) I believe

sly sphinx
#

^

#

besides that it looks correct to me

#

oh you should also use const for the array instead of var

glossy berry
#

tooltip version:

onEvent('item.tooltip', e => {
  let ban = []
  ban.forEach(item => e.add(item, Text.red('BANNED'))
})

Info version:

onEvent('jei.information', e => {
  let ban = []
  ban.forEach(item => e.add(item, 'BANNED')
})
#

yall hijacking my thread hmmm

sly sphinx
#

..your?

glossy berry
carmine anvil
#

teamwork makes the dreamwork

#

or whatever the phrase is.... >.>

glossy berry
#

something like that i think

#

if you add the items to the ban list, yes

#

and either choose the one from me, or the one from you

#

one will show when you press R and see the info tab
the tooltip will show up when you hover over the item

#

tooltip also allows for colors, like red

#

no

#

F3+T

#

yes, its a client reload

#

has nothing to do with server

#

let me see what you wrote

#

delete line 8

#

you are resetting the list to have no elements

sly sphinx
#

does let reset var

glossy berry
#

yes

#

both let and var can be changed at any time

#

const cannot be changed directly, unless you change the items inside a list or object

sly sphinx
#

yeah but will a variable defined by let be the same as a var one (i guess yes)

glossy berry
#

for instance if you have a const list, you can add and remove from the list, but you cannot assign it a different list or value

sly sphinx
#

yeah i figured

glossy berry
#

i cant think of the word right now

sly sphinx
#

since otherwise it couldnt know which one you mean when you use the name somewhere ig

glossy berry
#

let only works on the "level" its on (i forgot the word, its pissing me off) and deeper
var should work globally even outside

#

outside of where it was created

sly sphinx
#

yeah i know

glossy berry
#

im assuming rhino does the same as JS

glossy berry
#

hmmm send me your client.txt

#

locally

#

client things are always local

#

dedicated servers only have server and startup

#

/logs/kubejs/client.txt

hazy meadowBOT
#

Paste version of client.txt from @onyx plume

glossy berry
#

hm theres nothing there hmmm

silk light
#

Put a console.log in your event handler

#

See if it even fires

glossy berry
#

try to use Text.of('BANNED').red()

#

archives?

#

no, i told you server doesnt have client scripts

#

you do it locally

#

in your own KJS

#

you need to give it to everyone

#

thats the only way

#

xD

glossy berry
#

the one with the banned

#

rewrite it like mine :P

#

also

#

you are resetting the ban list again...

#

line 8

#

_>

#

youre not setting the tooltip to anything, cuz your list is empty

#

ok hold on..

#

i'll rewrite everything for you

#

replace EVERYTHING with this

#
onEvent('item.tooltip', e => {
  let ban = [
    'ftbic:nuke',
    'create:cart_assembler'
  ]
  ban.forEach(item => e.add(item, Text.of('BANNED').red()))
})
#

its alright :P

#

got it working