Solved Client side pumpkin

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ZeyKra_

Active Member
Dec 12, 2019
109
2
18
18
a baguette
Hello , I'm trying to make an client side pumpkin

Code:
import:
  java.lang.System
  java.lang.String as JavaString
  java.lang.Math
  org.bukkit.Location

command /packettest:
    trigger:   
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set itemslot field 0 of {_packet} to "head"
        wait a tick
        send player packet {_packet}

this code work good but it put the pumpkin on my feet
instead of putting the pumpkin on my head

upload_2020-3-3_19-1-43.png


do someone know why ???
[doublepost=1583263373,1583258564][/doublepost]Skript : 2.2-dev37c
Spigot: 1.8.8
Skript-mirror : 1.0.0 (I tried with 2.0.0)
 
Im not sure if this will work but you can try
Code:
set itemslot field 0 of {_packet} to slot 103 of player's inventory
 
  • Like
Reactions: ZeyKra_
Code:
import:
  java.lang.System
  java.lang.String as JavaString
  java.lang.Math
  org.bukkit.Location
  com.comphenix.protocol.wrappers.EnumWrappers.ItemSlot

command /packettest:
    trigger:   
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set itemslot field 0 of {_packet} to slot 103 of player's inventory
        wait a tick
        send player packet {_packet}

upload_2020-3-3_21-4-11.png
 
Maybe?
Code:
set itemslot field 0 of {_packet} to "%slot 103 of player's inventory%"
 
Interesting.. Im out of options.. I hope someone else will help you with this because I never used packets before.. Sorry, mate..
 
1.8.8 Didn't use a enum for the itemslot yet.

Code:
set short field 0 of {_packet} to 4

(if short doesn't work)
set int field 0 of {_packet} to 4

zxC95p8.png

Code:
package net.minecraft.server;

import java.io.IOException;

public class PacketPlayOutEntityEquipment implements Packet<PacketListenerPlayOut> {

    private int a;
    private int b;
    private ItemStack c;

    public PacketPlayOutEntityEquipment() {}

    public PacketPlayOutEntityEquipment(int i, int j, ItemStack itemstack) {
        this.a = i;
        this.b = j;
        this.c = itemstack == null ? null : itemstack.cloneItemStack();
    }

    public void a(PacketDataSerializer packetdataserializer) throws IOException {
        this.a = packetdataserializer.e();
        this.b = packetdataserializer.readShort();
        this.c = packetdataserializer.i();
    }

    public void b(PacketDataSerializer packetdataserializer) throws IOException {
        packetdataserializer.b(this.a);
        packetdataserializer.writeShort(this.b);
        packetdataserializer.a(this.c);
    }

    public void a(PacketListenerPlayOut packetlistenerplayout) {
        packetlistenerplayout.a(this);
    }

    public void a(PacketListener packetlistener) {
        this.a((PacketListenerPlayOut) packetlistener);
    }
}
 
This code still putting the pumpkin on my feet

Code:
import:
  java.lang.System
  java.lang.String as JavaString
  java.lang.Math
  org.bukkit.Location

command /packettest:
    trigger:   
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set short field 0 of {_packet} to 4
        wait a tick
        send player packet {_packet}

and this code do nothing but don't show error

Code:
import:
  java.lang.System
  java.lang.String as JavaString
  java.lang.Math
  org.bukkit.Location

command /packettest:
    trigger:   
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set int field 0 of {_packet} to 4
        wait a tick
        send player packet {_packet}
 
Again and again

Code:
command /packettest:
    trigger:   
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set short pnum 0 of {_packet} to 4
        wait a tick
        send player packet {_packet}

On my feet :emoji_disappointed_relieved:
 
Again and again

Code:
command /packettest:
    trigger:  
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set short pnum 0 of {_packet} to 4
        wait a tick
        send player packet {_packet}

On my feet :emoji_disappointed_relieved:

is updating to skript mirror 2.0 a problem or what was the errors u got then?
 
When I updated my skript mirror to 2.0.0 version my server took 0 minutre to load but i go test again with your code
 
Again and again

Code:
command /packettest:
    trigger:  
        set {_packet} to new play_server_entity_equipment packet
        set int pnum 0 of {_packet} to player.getHandle().getId()

        set itemstack field 0 of {_packet} to pumpkin
        set short pnum 0 of {_packet} to 4
        wait a tick
        send player packet {_packet}

On my feet :emoji_disappointed_relieved:
Can u also check these 2 imports for me if they load or give errors:


Code:
import:
    com.comphenix.packetwrapper
    com.comphenix.packetwrapper.WrapperPlayServerEntityEquipment
[doublepost=1583411288,1583411250][/doublepost]
When I updated my skript mirror to 2.0.0 version my server took 0 minutre to load but i go test again with your code
i am busy with a proper one with skmirror
[doublepost=1583412038][/doublepost]
Can u also check these 2 imports for me if they load or give errors:


Code:
import:
    com.comphenix.packetwrapper
    com.comphenix.packetwrapper.WrapperPlayServerEntityEquipment
[doublepost=1583411288,1583411250][/doublepost]
i am busy with a proper one with skmirror
nvm it will not
 
Status
Not open for further replies.