#Help with ProbeJS setup
262 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
wait i made a typo let me make sure that that's not all that was
okay yeah
doing something like Item. does bring up a list of methods though
lol and that was after i thought i fixed the first typo
nono still not working though
for me I setup probejs in minecraft, ran minecraft, ran the probejs commands, then went and opened the root directory of minecraft in vscode
and it works wonderfully
did you open the modpack folder itself or the kubejs folder?
ahh am i meant to open the root directory?
try that ye
hm. no dice
correct goto your .minecraft folder and open in vscode
u sure you ran the probejs in game
several times!
press f1
and enter TypeScript: Restart TS Server
Nothing :(
if all else fails reboot hehe
or try restart vscode
Developer: Reload Windows
like i said, if i type something like Item then it does show stuff
Mango do you think there is a vscode addin missing?
check files in minecraft/.vscode/
i'll reboot ig just to see. ntellij has definitely done stuff like that to me before lol
oh ok one sec
ProbeJS doesnt need any addon iirc
btw probejs actully have a vscode addon
but it doesn't require it
yep
Can you screenshot the whole screen?
when you ctrl+space do you get a dropdown... yeah thats the list
so it does work then
ctrl + i?
can you send logs?
yeah, one moment
where are intellij's logs?
soprry
vscode*
or do you mean mc logs
mc logs
sorry about there mess there a bunch of broken datapacks in there atm 
it'd be.. weird if that was what was causing issues but
let me try loading up a world without them just in case
@warm arch wait a min...
hm?
event name should be item.entity_interact
not item.entity_interaction
This is a list of all events. It's possible that not all events are listed here, but this list will...
in 1.18, probe will not generate typings for events which haven't been posted yet, try interacting with an entity and run the dump again
oh that sounds very much like it could be the cause
That's a little evil
why does it Do that 
1.18 didn't have the fancy 6.0 (6.1?) feature of events being registered, so no way to identify them beforehand
where can i access the more full docs online?
source
Because of the current state of proper KubeJS docs (eta: 5 years) the best way to find all the methods you can use is to read the source code.
Don't worry though, its not that scary! You just need to know the correct things to look for in the correct places.
The buttons below will guide you through reading a bit of source code.
Alright, thanks
so if i want probejs to be any good i should...
Open chests, close chests, interact with entities, etc etc, then generate?
I feel like this is the kind of thing that should really be in the tutorial as opposed to saying it just works
It acts as if when you first set up ProbeJS it will just have all this stuff by default
oh.. this didn't help actually
recipes works though.. so i imagine that must be the cause
uh, go to the events.d.ts file and search for item.entity_interact?
Oh wait no it doesn;t work on recipes I'm not sure what I saw that amde me think that
This is wack
try restarting vsc guess
already have a few times
is there no like.. collection of pregenerated files for 1.18? even if it's just assuming an otherwise vanilla game?
not that I know of
how exasperating
guess im spending the next hour going down the list and trying to find ways to set off every event 
as far as the source, i imagine things have changed in 1.19 and up
is there a link to the 1.18 source?
kube or probe?
the github branches are just labelled with ids
kube i think?
Whichever source is the intended way to get information on the different methods
yeah, use the 1802 branch
thx
ah i see
i was thrown off by the numbering
but looking at it now i see they are labelled
we addressed this already it's still broken
oh mb
odd
wait omg
that WASNT my typo i know I copy pasted
entity_interation im crying
this still doesnt solve my root issue i just think it is funny
yeah
ProbeJS is an add-on that is built exclusively to help you program.
What it does:
It generates doc...
how old is the tutorial
last updated nine monthsa go it's what's recommended for 1.18 afaik
i have bones to pick with this tutorial
??kjswiki
This is a list of all the events. Choose your version.
I hate the old wiki so much
its a horrible mis-mash of 1.16, 1.18, and some 1.19 stuff that its not event woth using expect for the bare basics
if it doesnt match with the current 1.18 wiki then its wrong
ive noticed.. 
is it in the server scripts btw?
Yeah
The event list is useful but it doesn't include event methods, which is the thing i actually particularly need
what are you trying to do specifically with the entity interact event?
i was only using entity interact to follow the tutorial and get a feel for kubejs and javascript
the tutorial's example is milking a goat
i see
my actual use case is a bunch of different stuff but my test run was gonna be giving players blindness when outside of given bounds
then teleporting them ~5k blocks opposite the direction they are facing
you mean when they're far away from spawn?
how far we talking?
we have a 6k x 6k map but we use the outside of the map for things so world barrier isn't an option
We used to use world wrapping but Immersive Portals was killing server performance in arcane and dark ways so we scrapped it
hmm
I could do this with datapacks but I'm hoping that we can move away from datapacks by using KubeJS scripting instead
with a combination of Celestial's fog and blindness I'm replacing world wrapping with dense fog that teleports you to the opposite end of the map when you've boated far enough
it would probably be a player tick event then
oh right you cant teleport boats so probably will involve killing the boat entity first, then teleporting the player, then giving them a boat item (or if it's within kubejs' power, mounting them on the boat again)
yeah
wym you can't teleport boats?
That I recall, teleporting a boat with a player in doesn't work
he probably means you cant teleport the player while they're in the boat
oh sorry
you'd probably need to teleport only the boat
so are all the events scattered in here? or is there a specific package i need to look in
It doesn't do anything
because riders move with their mounts
boats are
special
what if you do both?
It doesn't
I've worked with it before unfortunately
oof
minecarts are a different story but something about how boats are set up makes them an exception
this btw
Im okay using source for documentation but I wanna make sure im looking in the right place
EntityJS has a startRiding method, so I would imagine it has a stopRiding method
link it here if you could
unRide iirc
ah i see
err... dismountRidingEntity() becasue reasons
okay, so just tbc, it is just a matter of trawling that main package
.stopRiding()
hella
is it possible to detect if a player is a certain distance from 0,0?
It's a square bound
I'd be very surprised it it couldnt be done though
get player position, check if they are between minimum and maximum x / y
if (event.entity.x >= 5000 || event.entity.z >= 5000){
//dostuff
}else if (event.entity.x <= -5000 || event.entity.z <= -5000){
//dostuff
}```
here we go, this will detect the full square
where is the list of events in the source?
stuff like player.tick
what question
this?
oh you mean the methods for player.tick
btw your probe isnt working maybe cause you dont have the vsc plugin installed
I do
that'd be great. I've been browsing it but I can't find the player.tick event
Or really where any of the events are listed
I've found PlayerJS but that's for the player object best I can tell
..no, the github
yea link me what youre looking at
ty
I think this would be best served by a new post
found it
link?
er no not the github something even better
event.player.tell(Object.keys(event.player))```
sec ill impliment this into an easy way to see this, this will tell you(could also console log it) all the objects
hm. neat. You don't need to make anything for me though.
onEvent('item.right_click', event => {
const {item,player,item:{id}} = event
player.tell(Object.keys(event.player))
console.log(Object.keys(event))
})```
i dont mind
why do you not want me to make anything for you
seems like youre really bent on it lol
Because I find it more useful to get at the information at the source, as it were :P
alright
btw this is a page with some methods in it as well such as .teleport https://github.com/KubeJS-Mods/KubeJS/blob/1802/common/src/main/java/dev/latvian/mods/kubejs/player/PlayerJS.java
heres a working script with some examples of methods being used js onEvent('player.tick', event => { const {player,server,player:{x,y,z,persistentData}} = event persistentData.timer = (++persistentData.timer) % 20 //only runs this once every 20 ticks if (persistentData.timer != 1) {return} if (x >= 5000 || z >= 5000){ console.log('someone is out of bounds!') player.teleportTo('minecraft:overworld',0,100,4990,0,0) server.runCommandSilent('say test') }else if (x <= -5000 || z <= -5000){ console.log('someone is out of bounds!') player.teleportTo('minecraft:overworld',0,100,4990,0,0) server.runCommandSilent('say test') } }) //Initiates timer persistent data on login onEvent('player.logged_in', event => {event.player.persistentData.timer = 0})
if their x/z coord is more than 5k then they'll get teleported to a specified location, you can also run commands if that makes it easier for you to manage
Neat
the teleport method is actually in there on that page
it is, yes
though its really .teleport(dimension,x,y,z,yaw,pitch)
ye
is probe still not working even in the events i sent?
watch this first tutorial i send you, skip to like 30 seconds in where it talks about how to install probejs, maybe theres a step you skipped without realizing it
??tutorial
📼Youtube Tutorials📼
the custom blocks/items/effects
gonna generate off a clean game as discussed in the other thread


