Everything posted by MCrafterzz
- 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Yes it works (even for items!) but it takes a couple of ticks before they teleport so you still see the water particles.
 - 
	
		
		YouTube Tutorial for Kids
		
		Please do a door tutorial
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		But it doesn't work for entities either!
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		TP Command: p_189862_0_.setLocationAndAngles(p_189862_1_.getResult(), p_189862_2_.getResult(), p_189862_3_.getResult(), f2, f3); public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) { this.posX = x; this.posY = y; this.posZ = z; this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.lastTickPosX = this.posX; this.lastTickPosY = this.posY; this.lastTickPosZ = this.posZ; this.rotationYaw = yaw; this.rotationPitch = pitch; this.setPosition(this.posX, this.posY, this.posZ); } My code: entityIn.posX = worldIn.getSpawnPoint().getX(); entityIn.posY = worldIn.getSpawnPoint().getY(); entityIn.posZ = worldIn.getSpawnPoint().getZ(); So what is the big difference!!! Can't you just send a example how it should be instead of saying to look on the /tp command all the time
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Changed to: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { entityIn.posX = worldIn.getSpawnPoint().getX(); entityIn.posY = worldIn.getSpawnPoint().getY(); entityIn.posZ = worldIn.getSpawnPoint().getZ(); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } } But it doesn't work :c It does the same as setLocationAndAngles that /tp uses but only setting the location
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		I know, but I don't know what I should replace it with because that's how the TP command works (and it works with entities too).
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Ok, but I still don't know how to teleport players and other entities. My current code crashes
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Why would I need that?
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		WHAT??? The hopper has nothing with teleporting items
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		And how should I fix that?
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Because that's how the teleport command works. I still don't know how I should teleport things. I want players to teleport to there spawn point(in the same dimension) and item and other entities to teleport to the worlds spawn (in the same dimension)
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		New error: http://pastebin.com/TTrPzcdC Line 39(errored line): ((EntityPlayerMP) entityIn).connection.setPlayerLocation(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ(), entityIn.getRotationYawHead(), entityIn.getRotationYawHead());
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Changed it to this: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { if (entityIn instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityIn; BlockPos spawnPosition = player.getBedLocation(); ((EntityPlayerMP) entityIn).connection.setPlayerLocation(spawnPosition.getX(), spawnPosition.getY(), spawnPosition.getZ(), player.getRotationYawHead(), player.getRotationYawHead()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } else { ((EntityPlayerMP) entityIn).connection.setPlayerLocation(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ(), entityIn.getRotationYawHead(), entityIn.getRotationYawHead()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } } } Testing now
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		It crashes because of a null point exception. Crash: http://pastebin.com/H05XxPqj
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		I have removed one of the instanceof checks: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { if (entityIn instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityIn; BlockPos spawnPosition = player.getBedLocation(); entityIn.setPosition(spawnPosition.getX(), spawnPosition.getY(), spawnPosition.getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } else { entityIn.setPosition(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } } } But I still don't know how to use the commandteleport code
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Still looks the same with the latest forge version, http://www.minecraftforge.net/forum/Smileys/default/sad.gif
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		This is how the codes looks like now: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { if (entityIn instanceof EntityLivingBase) { if (entityIn instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityIn; BlockPos spawnPosition = player.getBedLocation(); entityIn.setPosition(spawnPosition.getX(), spawnPosition.getY(), spawnPosition.getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } else { entityIn.setPosition(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } } } }
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		So how should I do it then?
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Why can't I use: entityIn.setPosition Why does it even excist if it doesn't work?
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		I guess this is the code that I need to look at: http://pastebin.com/ySKJqdyV But nearly nothing have real names so it's hard to understand what it's accually doing
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Done, I will now take a look at the teleport command
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Changed to: @Override @SideOnly(Side.SERVER) public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn instanceof EntityLivingBase) { if (entityIn instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityIn; BlockPos spawnPosition = player.getBedLocation(); entityIn.setPosition(spawnPosition.getX(), spawnPosition.getY(), spawnPosition.getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } else { entityIn.setPosition(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ()); } } }
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		With the updated code that I just posted it no longer crashes. It teleports to a location that I think is right(?) for a fraction of a seconds but then it teleports back
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		Updated code: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn instanceof EntityLivingBase) { if (entityIn instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entityIn; BlockPos spawnPosition = player.getBedLocation(); entityIn.setPosition(spawnPosition.getX(), spawnPosition.getY(), spawnPosition.getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } else { entityIn.setPosition(worldIn.getSpawnPoint().getX(), worldIn.getSpawnPoint().getY(), worldIn.getSpawnPoint().getZ()); } } }
 - 
	
		
		[1.10.2][SOLVED] Teleport to the players spawn point
		
		I want players to teleport to there spawn point this is the code I've use (it crashes with a null Point exception): @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn instanceof EntityLivingBase) { EntityPlayer player = (EntityPlayer) entityIn; entityIn.setPosition(player.getBedSpawnLocation(worldIn, player.getBedLocation(), false).getX(), player.getBedSpawnLocation(worldIn, player.getBedLocation(), false).getY(), player.getBedSpawnLocation(worldIn, player.getBedLocation(), false).getZ()); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 0, 10, 0); } }
 
IPS spam blocked by CleanTalk.