# Dark Item :O

Comments in 'Plugin Development' started by RoboDaim, Aug 18, 2016.

1. Offline

### RoboDaimNew Member

Joined:
Aug 17, 2016
Posts:
5
Minecraft User:
Hello everybody. if I create the item in the crafting table : if I do not have ingredient , it appears dark in the crafting window . How to make dark item?

File size:
9.1 KB
Views:
38
2. Offline

### SurvingoActive Member

Joined:
Dec 6, 2015
Posts:
221
I believe it's an bug of MCPE 0.15,
so there are no dark items
3. Offline

### RoboDaimNew Member

Joined:
Aug 17, 2016
Posts:
5
Minecraft User:
but I saw dark items on a single server .How to make this bag in my plugin?
4. Offline

### MyNameIsTriXzNotable Member

Joined:
Aug 17, 2015
Posts:
538
Minecraft User:
Isnt that normal in MCPE? Items appear dark if you dont have them, thats client side.
Last edited: Aug 18, 2016
PocketKiller, Survingo and Primus like this.
5. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
6. Offline

### RoboDaimNew Member

Joined:
Aug 17, 2016
Posts:
5
Minecraft User:
Here is the proof that this is not the client side is the proof that this is not the client side

File size:
62.1 KB
Views:
36
7. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
Is that one server or mod?
8. Offline

### SOFeBanned

Joined:
May 28, 2016
Posts:
386
Minecraft User:
And maybe you should show some attempt how this can be achieved? Maybe you should tell us where we can reproduce this? Or maybe you can try using Wireshark to capture the packets?
9. Offline

### RoboDaimNew Member

Joined:
Aug 17, 2016
Posts:
5
Minecraft User:
I contacted the server creator , he said , that uses bug of item count
10. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
I predict that he sets Item amount to negative number. I'll test it soon.
11. Offline

### TheDeiboNotable MemberPlugin Developer

Joined:
Sep 8, 2014
Posts:
692
Plugins:
1
Minecraft User:
I am also adding to this,

Here is a rough outline of my idea
If \$player has the item ID of 1> the. Quantity =-1
12. Offline

### SOFeBanned

Joined:
May 28, 2016
Posts:
386
Minecraft User:
Have you confirmed this? I thought item count was sent in unsigned bytes.
13. Offline

### TheDeiboNotable MemberPlugin Developer

Joined:
Sep 8, 2014
Posts:
692
Plugins:
1
Minecraft User:
Well, mines just theory. Theorys can change
14. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
Giving an Player item with negative amount doesn't reproduce this, although I might be wrong and doing it this way
PHP:
 PlayerInventory::addItem() 
won't work. I'm trying to figure out other ways right now.

Edit: Okay, addItem() function won't allow to add item with negative Item number, that's why it didn't work. Anyone knows any other way?
Last edited: Aug 21, 2016
15. Offline

### SOFeBanned

Joined:
May 28, 2016
Posts:
386
Minecraft User:
Simple way: Join that server, enable wireshark, see what is sent to the client.
Now please tell us how to access that server to prove that it exists, or show a wireshark dump if you want us to help you without wild guessing.
16. Offline

### PrimusNotable Member

Joined:
Apr 7, 2015
Posts:
1,470
Minecraft User:
PocketMine treats items with negative number same as empty slot. Nothing got send to client.
17. Offline

### SOFeBanned

Joined:
May 28, 2016
Posts:
386
Minecraft User:
Send a direct packet with 0 as item count to confirm?
18. Offline

### TheDeiboNotable MemberPlugin Developer

Joined:
Sep 8, 2014
Posts:
692
Plugins:
1
Minecraft User:
I have many ideas although I don't have time to test them. (they are theorys, and not to be taken to be correct.) I will leave them on this post in case anyone wants to try.
• Negative negative 1 (--1)
• A constant (but laggy) process of constantly adding and removing item. (Loop). Possibly it looks black on the clients side.
• Internal Problems in the src\pocketmine\item causing it to glitch? (could be in Player.php too, because it is a player's problem. Possibly even client side problems)
• Possibly its simply banned the item with any ban-item plugin
19. Offline

### SOFeBanned

Joined:
May 28, 2016
Posts:
386
Minecraft User:
Remember that eventually the packet data are sent to the client in a byte NBT tag, i.e. it must be an integer 0≤x<256 (or -128 to 128). Negative negative one means 1.
Repeatedly blinking the item will result in visible blink, because I doubt if packets sent per tick can really arrive ar the client per 50 ms. Instead, they are sent in groups, looking to the client as irregular but still visible change. Furthermore, you can't screenshot like that.
About your third or fourth points, you didn't explain anything relevant to the client.
20. Offline

### TheDeiboNotable MemberPlugin Developer

Joined:
Sep 8, 2014
Posts:
692
Plugins:
1
Minecraft User:
I did say they are theorys