Everything posted by HappyKiller1O1
-
[1.7.10] Need my item to get the players display name
So, you want me to like add the enchantment in an anvil to the item and see if it stays?
-
[1.8] terrain generator how to spawn in thesurface ??
Those sentences though.
-
[1.7.10] Need my item to get the players display name
@Abastro Why? I'm pretty sure either you or I are not getting something here. @elix What do you mean?
-
[1.7.10] Need my item to get the players display name
No no no. I don't want it to be enchant-able. It's not a tool just an item.
-
[1.7.10] Need my item to get the players display name
So, the NBT tag returns null on client side I'm guessing? Anyway to prevent this?
-
[1.7.10] Need my item to get the players display name
No it cannot. Nor can it be repaired, enchanted and has durability.
-
[1.7.10] Need my item to get the players display name
Yup! It get's the player and saves all the data no problem. But, when trying to access it for the information... nothing.
-
[1.7.10] Need my item to get the players display name
Let me try that... I feel like it would crash considering NBT is run on server side?
-
[1.7.10] make tools not break
Try adding the onUpdate method to your tool class. In it try telling it this: if(this.getDamage <= 0) { //set damage to 0 //change tool material to something that can not mine or cause damage? //Do whatever else you want } The onUpdate method runs every tick for the item. Pretty sure you can do what you want in there.
-
[1.7.10] Problems with Extended properties
("lenght") Never seen that word before.
-
Minecraft crash when creating new world 1.8
The extra mods seem to be crashing your game. Remove the ones you've added and just work with the one you're making.
-
[1.7.10] Need my item to get the players display name
That is an override of the item class one. It interacts with the player just fine but, the nbt tag seems to return null upon setting it for display.
-
[1.8.*] Trouble Setting Item to NULL
Without a crash report it's hard to say but, it may be that your NBT is still writing the null item? Or reads it while the item is null? If not that, maybe you need to use a preset method to consume the item in slot.
-
[1.7.10] Need my item to get the players display name
So, the reason why it's not displaying the name is because the stack compound tag is null. I'm not sure how considering the server console says it set the tag. Here's my code (Will use UUID after my testing is complete): public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) { if(entity.worldObj.isRemote) { return false; } if(entity instanceof EntityPlayer) { System.out.println("ENTITY GOTTEN"); EntityPlayer victim = (EntityPlayer)entity; NBTTagCompound cmp = new NBTTagCompound(); String displayName = victim.getDisplayName(); cmp.setString("victim", displayName); stack.setTagCompound(cmp); System.out.println("ORIGINAL DISPLAY NAME: " + displayName); System.out.println("SAVED DISPLAY NAME: " + cmp.getString("victim")); return true; }else { System.out.println("ENTITY WAS NOT PLAYER"); } return false; } public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag) { String defaultDisplay = "No Victim Set"; String victimDisplay = null; if(stack.getTagCompound() != null) { System.out.println("STACK COMPOUND WAS NOT NULL"); victimDisplay = stack.getTagCompound().getString("victim"); }else { System.out.println("STACK COMPOUND WAS NULL"); } list.add(EnumChatFormatting.DARK_AQUA + "When right clicked, it fires"); list.add(EnumChatFormatting.DARK_AQUA + "lightning upon the bound player."); list.add(""); list.add(EnumChatFormatting.RED + "Can only be used four times."); list.add(""); list.add(victimDisplay != null ? victimDisplay : defaultDisplay); list.add(""); list.add(EnumChatFormatting.GREEN + "Hold Shift and Right-Click to"); list.add(EnumChatFormatting.GREEN + "open the victim set menu."); } Any reason why this is caused?
-
[1.7.10] Need my item to get the players display name
Hm, I'll get to trying that! My question still remains about how to right click a player with my item and it detect it.
-
[1.7.10] Need my item to get the players display name
Now see, I understand using the UUID for the player. But how would I get the display name? Would I do something like this?: EntityPlayer player = entityLiving.worldObj.getEntityByID(//Player UUID).getDisplayName();
-
[1.7.10] Need my item to get the players display name
I know I mean, I have to call UUID's from the server, right?
-
[1.7.10] Need my item to get the players display name
playerEntity is apart of the server world object, correct?
-
[1.7.10] Need my item to get the players display name
What I read is that only 1.8 and above will see viewable changes to the display name. But might as well take your advice. How would I go about using UUID for the display name?
-
[1.7.10] Need my item to get the players display name
I get the display name because of name changing not being implemented in 1.7.10. Once I update it I'll change the code.
-
[1.7.10] Need my item to get the players display name
Actually I am. I probably messed something up because I wrote it late at night. Here's the two methods: public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) { if(entity.worldObj.isRemote) { return false; } if(entity instanceof EntityPlayer) { EntityPlayer victim = (EntityPlayer)entity; NBTTagCompound cmp = new NBTTagCompound(); String displayName = victim.getDisplayName(); cmp.setString("victim", displayName); stack.setTagCompound(cmp); System.out.println("ORIGINAL DISPLAY NAME: " + displayName); System.out.println("SAVED DISPLAY NAME: " + cmp.getString("victim")); return true; } return false; } public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag) { String defaultDisplay = "No Victim Set"; String victimDisplay = null; if(stack.stackTagCompound != null) { victimDisplay = stack.stackTagCompound.getString("victim"); } list.add(EnumChatFormatting.DARK_AQUA + "When right clicked, it fires"); list.add(EnumChatFormatting.DARK_AQUA + "lightning upon the bound player."); list.add(""); list.add(EnumChatFormatting.RED + "Can only be used four times."); list.add(""); list.add(victimDisplay != null ? victimDisplay : defaultDisplay); list.add(""); list.add(EnumChatFormatting.GREEN + "Hold Shift and Right-Click to"); list.add(EnumChatFormatting.GREEN + "open the victim set menu."); }
-
[1.7.10] Need my item to get the players display name
Well, basically I have it add information if the stack NBT tag is not null. The information on the item was not set so, it didn't run. I commented out my system print outs by accident before running the server and shit. DERP
-
[1.7.10] Need my item to get the players display name
Well, I made a server and had my brother join. I did add this though: if(entityLiving.worldObj.isRemote) { return false; } Would that break the code?
-
[1.7.10] Need my item to get the players display name
Sorry. I mean when I right clicked the player it didn't run the code. I'm not sure if you're suppose to use the EntityPlayer provided.
-
[1.7.10] Need my item to get the players display name
Now see, I tried that but, when I right clicked a player (tested it on a server) it returned nothing as if it wasn't the player.
IPS spam blocked by CleanTalk.