-
Content Count
12 -
Joined
-
Last visited
Community Reputation
1 NeutralAbout naelsun
-
Rank
Tree Puncher
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
[1.16.2] How do I teleport a player to their spawnpoint
naelsun replied to naelsun's topic in Modder Support
Well i agree that solving is the best part, i think it's just that i tried to do too much too fast, i just woke up now and i have been now looking at libraries trying to understand what's left to do for the last hour, also i have to thank you for not just giving me the solution, i just didn't realise because i misread, i really want to learn, i guess i'll just have to brainstorm a lot, so thank you again, i'll give you an update if i can find anything (i'm a bit late now but as you saw, yes, yes it does) -
[1.16.2] How do I teleport a player to their spawnpoint
naelsun replied to naelsun's topic in Modder Support
I’m really sorry, i should have reaserched more before trying to make a mod, every answer i get there is something i don’t understand, like what do you mean by moving the player? Sorry for bothering so much -
[1.16.2] How do I teleport a player to their spawnpoint
naelsun replied to naelsun's topic in Modder Support
Thank you so much for all your help, but i still couldn't make it work, is it because im using the LivingEntity parameter instead of the Player one? @SubscribeEvent public static void onFoodEaten(LivingEntityUseItemEvent.Finish event) { if (event.getItem().getItem() == RegistryHandler.GOLDEN_CHORUS_FRUIT.get()) { if (!event.getEntityLiving().getEntityWorld().isRemote) { ServerPlayerEntity player = (ServerPlayerEntity) event.getEntityLiving(); ServerWorld respawnWorld = player.server.getWorld(player.func_241141_L_()); BlockPos spawn = player.func_241140_K_(); float spawnAngle = player.func_242109_L(); boolean forcedSpawn = false; boolean preserveAnchorCharges = true; Optional<Vector3d> maybeSpawn = PlayerEntity.func_242374_a(respawnWorld, spawn, spawnAngle, forcedSpawn, preserveAnchorCharges); } } } -
[1.16.2] How do I teleport a player to their spawnpoint
naelsun replied to naelsun's topic in Modder Support
BlockPos bed = PlayerEntity.func_242374_a(); double px = bed.getX(); double py = bed.getY(); double pz = bed.getZ(); Minecraft.getInstance().player.sendChatMessage( "/tp " + px + " " + py + " " + pz ); Well this definetly seems too complex to me, that is what i have after some head scratching and i doubt i'm even close to it, since the func is asking for 5 arguments that i have no clue what might be, and even though i think i understand how the PlayerEvent.Clone event works i have no idea how to implement it. So what i'm asking is: am i close to getting it? Thank you again for helping btw! -
naelsun changed their profile photo
-
I wanted to teleport a player to their spawnpoint (bed, respawn anchor or if those two are unavailable the world spawn), but i can't find anything, could you help please?
-
[1.16.2] Triggering event if a specific food item is eaten
naelsun replied to naelsun's topic in Modder Support
Oh I get it now, thank you so much for everything! -
[1.16.2] Triggering event if a specific food item is eaten
naelsun replied to naelsun's topic in Modder Support
I'll try to figure it out then, thank you for your help! -
[1.16.2] Triggering event if a specific food item is eaten
naelsun replied to naelsun's topic in Modder Support
Thank you for the help, but i'm not really understanding what you mean, i'll understand if you don't want to but could you explain please? -
[1.16.2] Triggering event if a specific food item is eaten
naelsun replied to naelsun's topic in Modder Support
Yes it is my custom food item, i am using LivingEntityUseItem event, but the only way i found to check is checking the item held by the player, i'll post what i wrote @SubscribeEvent public static void onFoodEaten(LivingEntityUseItemEvent.Finish event) { LivingEntity player = event.getEntityLiving(); if (player.getHeldItemMainhand().getItem() == RegistryHandler.GOLDEN_CHORUS_FRUIT.get()) { World world = player.getEntityWorld(); } } This works, but onlt if the player is holding more than one of the food presented, is there another way to check if the player is eating a specific item? -
I have very little knowledge on modding so sorry if this is obvious and I just don't know how, but I want an event to be triggered when a specific item is eaten, is it possible? If so how? Thank you in advance!