Java
Anyone got any ideas why this isn't working? I would have thought this code when called would spawn the custom model in the position of the player? (I'm not getting any console errors)
Anyone got any ideas why this isn't working? I would have thought this code when called would spawn the custom model in the position of the player? (I'm not getting any console errors)
You can add individual attributes
Thanks I should have though of this really being as though the whole custom GUI works this way
I second that
however using item.getName() I simply get "apiitem"
Hmm this is actually causing some roadblock for me. I can't work with the items I've added as I have no means to differentiate between them.
The names, including definition name are all "apiitem" and the getTypeID are all the same at 890.
Edit: I can't even hack around it using different max stack sizes as the event.getItem().getMaxStacksize() for all custom items return 1 even though that's not the set max stack size.
Sorry @red51 yet another message!
The method:
Work well for adding new custom items to the inventory (in the first available free slot or stacks if item already exists), however, it does not generate the nice inventory addition notification/animation on the lower right hand corner of the screen.
The following method does generate a nice notification/animation on the lower right hand corner;
However, the above second method requires that I specify a slot (in my examples case - slot 0) the result of which is the item already occupying the slot(0) gets deleted.
Now I have tried writing some code to analyse the inventory (so I can use method 2) so I can allocate the correct slot (or stack if needed), however using item.getName() I simply get "apiitem" which isn't going to work.
The ideal solution would be a notification/animation on method 1.
Or, a new method like method 1;
I doubt this is something Red can magically fix.
The lesson is, never listen to Yahwho
Just to confirm, I tried again on a clean server restart (i.e. no reloadplugins command used). I found one Emerald then stopped (I actually went away and grabbed a coffee) I came back and continued mining and found a second Emerald. Although (correctly) I had one more added to my inventory the lower right hand corner notification said I had found 2x Emerald.
This is the code snippet I am using to add custom item to inventory:
I have been using "rp" console command a lot, I will check that this isn't causing the weird behaviour and update.
I appreciate the 3x Coal underneath on both might confuse things. But that was just by chance!
@red51 yes I know about the 1-2 seconds feature the second item was added about 5 minutes later
hehe and there's the magical fix
Look forward to seeing this complete ist sehr gut
Hi guys,
There's nothing wrong with the API GUI features. My servers' custom GUI is working the same as before?
It sounds like the plugin developers need to take a look and fix their plugins, I doubt this is something Red can magically fix.
Hi @red51 I'm using this code to add gems to a players inventory:
When a player finds a gemstone and they currently do not have one in their inventory the notification shows correct ( 1x Emerald * )
However, the second one found shows up at ( 2x Emerald * ) even though only one is added to the inventory (meaning they now have 2).
@red51 will there be an world temperature one too?
A new hotfix will be available tomorrow
Thanks for the heads up! Yep one gemstone down, 9 more to go.
People get minerals on your server?
Yep, there have been gemstones for quite some time now but they were instantly sold. Red's new update makes it way more fun now as they go into your inventory instead.
Hi @red51
Custom items are bloody awesome addition thank you! I'm sure the folk on Medieval Realms are going to love getting their gemstones in their inventory instead of instantly being converted to cash.
One problem though, the stacks spit fine, but when you try to stack them back up they won't stack until you close the inventory down and re-open up. A wee bug I think?