@red51 thanks for your help (again )
Just one final question on custom objects, is it possible to make them effected by gravity?
@red51 thanks for your help (again )
Just one final question on custom objects, is it possible to make them effected by gravity?
make sure that the model scale is not too big or too small
This was my problem!
The object was so big I was standing inside of it!
This is one LARGE ruby!!
Hi, just thought I would mention that the code;
doesn't work for multiple commands of spawning a skeleton
For example;
Will spawn a pig and cow, and ;
will spawn two sheep, but;
Will only spawn one skeleton, a new skeleton can only be spawned with this command after a reboot.
The latter, it's compiled and moved into the plugin directory.
The object (j3o file) and texture (dds) both do work as they are linked with a custom object which can hold in the players hand and even drop on floor.
I'll try again with the world generation of the object today and will update
Worked perfectly! Thanks Red
Hmmm okay I'll take another look
For some odd reason this makes me want to drink rum!
Thanks @Devidian I'll go give that a try.
Edit: still nope
player.addWorldElement(new World3DModel(modelInfo,imageInfo,player.getPosition(),player.getRotation()));
I think what you suggested was effectively the same as what I already tried, but all in a single constructor.
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.