Cuberite Forum
Players Inventory - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Players Inventory (/thread-312.html)

Pages: 1 2


Players Inventory - tbar - 01-24-2012

How do you populate the players inventory? I've tried by editing the file players\<playername>.json but that doesn't seem right... and they only work temporary when used...


RE: Players Inventory - FakeTruth - 01-24-2012

Well, that should work actually.

But what do you mean? Do you want to give players items by using a plugin?


RE: Players Inventory - tbar - 01-24-2012

Any Items would be great. Right now Inventory is completely empty and I want to remedy that.

When I did change values in <playername>.json the items would appear in the Inventory but when used they would disappear (not from the inventory but from the world).


RE: Players Inventory - FakeTruth - 01-25-2012

Just chat "/i itemname" like "/i cobblestone" and you'll get that item :O

I don't understand what you mean by the item disappears. When you use an item it Minecraft it's normal that the item disappears from your inventory and is placed in the world.


RE: Players Inventory - tbar - 01-25-2012

Sorry but I cant get /i itemname to work. It just prints "/i cobblestone" on the screen as if it were a message to the other players... Am I missing a plugin? I've got Core and MagicCarpet loaded according to /pluginlist.

I've been able to get dirt and lava by changing the .json-file. If I create a block of these in the world they appear but after approx 5 secs they disappear again. If I step in the lava I burn...


RE: Players Inventory - FakeTruth - 01-25-2012

Odd..

But the reason /i does not work is most likely because you do not have permission to use it. You should make yourself admin on the server http://mc-server.org/wiki/doku.php?id=install:permissions


RE: Players Inventory - tbar - 01-27-2012

(01-25-2012, 02:21 AM)FakeTruth Wrote: Odd..

But the reason /i does not work is most likely because you do not have permission to use it. You should make yourself admin on the server http://mc-server.org/wiki/doku.php?id=install:permissions
Yeah, that helps... I didn't setup groups.ini prior to connecting through the mc-client...

Is it possible to populate the inventory automatically for newcomers? I don't want to administrate within mc, only the server-side of things...

(I'm not building the server for myself but for my daughter and I just want to keep things as simple as possible from an administrative point of view..)



RE: Players Inventory - FakeTruth - 01-27-2012

This is possible by using a plugin that adds items to a player's inventory on connect

Put this code
Code:
    local NewItem = cItem( ItemID, ItemAmount, ItemMeta )
    Player:GetInventory():AddItem( NewItem )

In this hook http://mc-server.org/wiki/doku.php?id=api:plugin:onplayerjoin

And it should work :O If you want I can create this plugin for you


RE: Players Inventory - tbar - 01-27-2012

(01-27-2012, 03:05 AM)FakeTruth Wrote: If you want I can create this plugin for you
That would be awesome if you would do that!! Smile




RE: Players Inventory - FakeTruth - 01-29-2012

Extract this file into your Plugins directory (including the SpawnWithItems directory)

.zip   SpawnWithItems.zip (Size: 717 bytes / Downloads: 289)

Open settings.ini and add NewPlugin=SpawnWithItems in the Plugins header, so it looks something like this
Code:
[Plugins]
...
NewPlugin=SpawnWithItems
...

It's important that you grab the latest version of MCServer, since this plugin only works with the latest version