#My Own Custom TPA need help teleport isn't working for global buttons
1 messages · Page 1 of 1 (latest)
I am debugging as to why i have this message
to make sure the coords were saving and dimension etc
There are 3 errors in this [code](#1096711115053994004 message):
[36mtpa.js[0m:[33m3[0m:[33m20[0m - [31merror[0m[30m TS2307: [0mCannot find module './config' or its corresponding type declarations.
[7m3[0m import config from "./config";
[7m [0m [31m ~~~~~~~~~~[0m
[36mtpa.js[0m:[33m9[0m:[33m8[0m - [31merror[0m[30m TS2307: [0mCannot find module './db/JsonTagDB.js' or its corresponding type declarations.
[7m9[0m } from "./db/JsonTagDB.js";
[7m [0m [31m ~~~~~~~~~~~~~~~~~~~[0m
[36mtpa.js[0m:[33m144[0m:[33m37[0m - [31merror[0m[30m TS2551: [0mProperty 'getDimensionById' does not exist on type 'World'. Did you mean 'getDimension'?
[7m144[0m const targetDimension = world.getDimensionById(targetTeleport.dimension);
[7m [0m [31m ~~~~~~~~~~~~~~~~[0m
[36m@minecraft/server.d.ts[0m:[33m13924[0m:[33m5[0m
[7m13924[0m getDimension(dimensionId: "overworld" | "nether" | "the end" | "the_end" | "minecraft:overworld" | "minecraft:nether" | "minecraft:the_end"): Dimension;
[7m [0m [36m ~~~~~~~~~~~~[0m
'getDimension' is declared here.
awh
i will try that
using chat gpt lol
and its very close but way faster to code
use
player.dimension.id.replace("minecraft:", "")
sorry where should i place this?
y not use the dimension itself...
Any variable
awh
wdym
work in progress haha
just the global is giving me issues
Gonna change icons and make it look cleaner
later
What is global teleport
the global teleport is the issue im having let me show you. if i create my teleport (if allows one teleport for each player)
nvm, ur actually using there ig
im confused
that creates public waypoints?
yeah pretty much im just butchering this code tryn to get the telepor to work globaly for all players
its for players to create their own teleport
just location and dimension should be enuf
sounds like a sethome
and then i will make a warning and say there is a risk it could be a trap kind thing
Add a delay
yes, but i need to be able to call it globally, which i believe works in my database
but the teleport isn't working so idk
its a mess
global ones...
Like player sets their global waypoints and all players can use it?
get all players tags and check if global exist then show the button ig
Thats what im thinkin'
but i was hoping for players teleports to work if they are offline
because it should just be a saved location
Oh okay, save it then
teleport(loc,dim,x,y)
it does i think, but its not calling it properly lol so idk i need to think a little better on what the issue is i hate debugging lol
u forgot x and y
awhhh
so this is missing the x and y
player.teleport(targetTeleport.location, targetDimension);
ye
thanks let me give this a go
xrot and yrot
player.getRotation().x and player.getRotation.y
awh
So it doesn't teleport player in a straight face
does ur console.log even work?
try this one```js
const { warn } = console, { stringify } = JSON;
globalThis.log = async function (data, n = 3) {
if (data instanceof Error) {
const { message, stack } = data
return warn(message, stack)
};
n ? data = stringify(data, 0, n) : null;
warn(data)
}
paste it on top of ur main.js or index.js or idk
then use it like
log({targetTeleport})
they are not, let me give this a go