Jump to content

naelsun

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

naelsun's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. I wanted to check if a player is in the overworld, in the nether or in the end, and if his spawnpoint is in another dimension, cause an explosion, is it possible?
  2. 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)
  3. 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
  4. 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); } } }
  5. 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!
  6. 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?
  7. Oh I get it now, thank you so much for everything!
  8. I'll try to figure it out then, thank you for your help!
  9. 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?
  10. 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?
  11. 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!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.