Jump to content

Coder

Members
  • Posts

    94
  • Joined

  • Last visited

Posts posted by Coder

  1. I know this sounds a little weird, but I would like to have an event listener for when the boss name in the boss bar on the top of the screen is changed. This is a client-side only mod so I can't do anything with the server to inform the client about a name change.

    Is it possible that there's a listener for something like this?

  2. I am trying to send a client-side message to the user upon successful connection to any Minecraft server.

    I am listening to ClientConnectedToServerEvent, when it happens I use player.sendMessage() to send a client-side only message. Unfortunately, I get a null pointer exception when doing so.

    Can it possibly happen because it sends the message too early?

  3. I am trying to get the number of how many empty inventory slots there are, we are talking about hotbar + regular inventory, without armor and without the second hand.

    Just all of these: http://prntscr.com/jh0ucf

     

    I tried using 

    player.inventory.getFirstEmptyStack()

    But as you can tell it will tell me if there is any space in the inventory, not how many slots there are empty.

  4. 1 minute ago, diesieben07 said:

    What are you even talking about... Yes, you can "target the entry and change it". I told you which method you need to use like 5 times already. You failed to mention why it does not work for you.

    And I fail to understand how this is in any way useful. If you are unlucky your change will not even survive for one tick.

    That's what I don't understand here. How can I get the full Lore array modify it and set it back again, without messing around with the "Name" or anything else.

    As I said, it's inside display and inside Lore, how can I get it using the other stuff you mentioned, from what I see there you enter the nbt comp and an index.

  5. Just now, diesieben07 said:

    The data is going to get overridden by the server as soon as you move anything in your inventory.

    I know, it's fine. I just want to know how to change it for the moment.

    It would be much easier if I could just target the entry and change it. But looks like it's not possible, thus meaning I need to recreate the nbt compound.

  6. Just now, diesieben07 said:

    You say "set by server". Does that mean you are writing a client-only mod? If so, this cannot work. You could set it temporarily for this specific client using ItemTooltipEvent. If you want to actually change the NBT in the stack, it must be done on the server. And in that case I still do not understand what the problem with the proposed method is.

    Yeah I know, I would like this to be client side only for the session only (or to whenever the server changes it).

  7. 1 minute ago, diesieben07 said:

    I am sorry, but I am not quite following what your issue is. The set method I mentioned sets the entry at a specific position in the list.

    I would like to change one Lore array entry inside an existing item (Lore set by server, not in my control), so I get the ItemStack and what I would like to do it enter display > Lore > index of my choice, and set it to something else.

  8. I am getting the nbtcompound from ItemStack, and I would like to edit one entry in the Lore array without needing to recreate everything..

    Is editing one entry in the Lore array inside the item NBT possible? Perhaps somehow converting the existing nbt to a variable and changing it that way?

  9. I am trying to get information about an item entity via listening to EntityJoinWorldEvent. 

    When there is a new item on the ground I get a confirmation in the console, but when I try getting the items data entries I an array of these:

    net.minecraft.network.datasync.EntityDataManager$DataEntry@79d5182f

     

    Can I somehow view what these are?

    I get these via event.getEntity().getDataManager().getAll()

  10. 10 hours ago, diesieben07 said:

    EntityItem::getItem gives you the ItemStack.

    Can I get this using the EntityJoinWorldEvent?

    This is what I managed to do so far:

    @SubscribeEvent
        public void entityIn(EntityJoinWorldEvent event) {
    		if (event.getEntity() instanceof EntityItem) {
    			System.out.println("New entity item "+event.getEntity());
    		}
            
        }

    -----

    10 hours ago, Draco18s said:

    Lore. L-O-R-E.

    Also more correctly called "tooltip information".

    Lure is something else entirely.

    Oh, oops!

  11. Hi,

     

    I am trying to make it so the player will be able to see an item's name when the item is on the ground. All I found in the EntityItem class is the getName() but it just gives me the name back, nothing else.

    Can I somehow iterate though all the item entities there are and enable the Display Name parameter like in the vanilla /entitydata command?

     

    Thank you.

×
×
  • Create New...

Important Information

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