vin0m
Members-
Posts
36 -
Joined
-
Last visited
Everything posted by vin0m
-
I'm using the code below to get the team info for an entity within the AABB. The issue I am having is that when playing on a server, the team info is only provided correctly when I use "if(world.isRemote)" and the potion effect only works when I use "if(!world.isRemote)". Can someone help me figure out what I am doing wrong? if(!world.isRemote){ AxisAlignedBB bb = new AxisAlignedBB(x1, y1, z1, x2, y2, z2); entL = world.getEntitiesWithinAABB(EntityLiving.class, bb); listSize = entL.size(); int i = 0; for(EntityLiving el : entL){ elName = el.getName(); elUUID = el.getUniqueID().toString(); elTeam = el.getTeam(); playerTeam = player.getTeam(); player.addChatMessage(new TextComponentString("Name: "+elName)); player.addChatMessage(new TextComponentString("elUUID: "+elUUID)); player.addChatMessage(new TextComponentString("elTeam: "+elTeam)); player.addChatMessage(new TextComponentString("playerTeam: "+playerTeam)); if(playerTeam != elTeam){ el.addPotionEffect(new PotionEffect(Potion.getPotionById(2), 100, 127)); } i++; } }
-
Got it working. thanks for the tips all.
-
I tried bringing the methods over from entity class last night. I couldn't seem to get it to work. I'll have to give it a try again tonight. Other than bringing the methods over is there anything else I'd need to do?
-
Does anyone have any examples of how to accomplish this?
-
How would I go about getting the coords where the player is looking? I was using: RayTraceResult target = Minecraft.getMinecraft().getRenderViewEntity().rayTrace(15, 1.0F); From what I understand this only works client side. Is there an equivalent for server side or will I need a workaround?
-
I'm trying to do something similar with identifying targeted Entities. Here's the code I have now: @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player, EnumHand hand) { if(Minecraft.getMinecraft().objectMouseOver.entityHit != null){ Entity Target = Minecraft.getMinecraft().objectMouseOver.entityHit; if(Target instanceof EntityLiving){ } } } The code does what I want it to do but I have to be in very close proximity. What would I need to do to extend the reach for this?
-
I use scripting now as well. A lot more powerful than using command blocks. If anyone needs help with scripting search "Daot" on you tube. He has some good tutorials.
-
Thanks everyone! That did the trick.
-
My mod works fine on the client side but when I try and load the server I get an error that I can't figure out. I'm new to modding. Any help would be appreciated. Error: Main java file: Common Proxy: Client Proxy:
-
When I try to use a Custom NPC command through a command block (i.e. "/noppes npc SomeNPCName create") I get the message "You are not allowed to use this command". Is there any way I can fix this?
-
I'd like to assign a model to a player via a command block. Is this possible?