java


EntityMetadata packet issue


I am attempting to make a player appear like they are sneaking (crouching) on Minecraft 1.8.8 running Spigot, based on http://wiki.vg/Entities#Entity_Metadata_Format I have done the following:
Created a data watcher and mapped appropriate value for crouched from the wiki:
DataWatcher dw = new DataWatcher(null);
dw.a(0, (byte) 0x02);
Created the packet, where target is a Player object of the player that needs to appear sneaking:
PacketPlayOutEntityMetadata metadataPacket = new PacketPlayOutEntityMetadata(target.getEntityId(), dw, false);
Sent the packet to everyone online:
for (Player p : Bukkit.getOnlinePlayers()) {
((CraftPlayer) p).getHandle().playerConnection.sendPacket(metadataPacket);
}
This does not appear to be working though, how would be the appropriate way to go about this?
I attempted to use ProtocolLib too, though ideally I am looking for a solution that works using packets.


Related Links

Compute recursively the largest substring which starts and ends with sub and return its length
Spring query distinct on a entire object
Getting broken pipe error in the following program
Item Click on GridView.CHOICE_MODE_MULTIPLE_MODAL closes the modal
PayPal Java ButtonManager SDK service calls fail on SSLenabled server due to SocketException: Connection reset
servlet processing http request and forwarding to socket server
Spring 3 View Resolver return multiple views
Android6.0 WebView shows blank page
Why is android client unable to call endpoint methods?
Null Pointer Exception with queryForObject [duplicate]
images from database to jtable java sql
Google guice injector for Servlets returns 500 error
Android Studio run function in background repeatedly
RecyclerView shift items
Create dynamic classes with reserved words as variables
Getting org.omg.CORBA.OBJECT_NOT_EXIST while calling CORBA service using Weblogic 11g

Categories

HOME
winforms
image
cloud
listview
plot
raspberry-pi
lodash
office365api
electron
alfresco
jira
spring-cloud-stream
google-oauth
elm
react-redux
amortized-analysis
malloc
sharepoint-designer
cakephp-2.5
win32gui
indesign
directx
autotools
append
adfs
applepay
ssl-client-authentication
nano-server
spring-xd
etl
google-apps-marketplace
hex-editors
netflix
amazonsellercentral
ml
orleans
google-search-api
cultureinfo
lcd
autosys
applozic
kendo-datasource
newline
tinymce-4
bcd
nameservers
uisplitview
grails-3.1
caret
framemaker
cloud-code
normal-distribution
android-ble
retina-display
android-browser
starteam
ibpy
acoustics
s
segment
wptoolkit
smartcontracts
zip4j
mu
aurelia-validation
brightcove
forever
sybase-asa
pearson
pillow
gcsfuse
imanage
bind9
lync-client-sdk
dynamics-sl
sonarlint-vs
removechild
azure-virtual-network
paypal-express
essence
fadeout
captivenetwork
php-parse-error
spim
jmeter-maven-plugin
spidermonkey
drawbitmap
sniffer
mmc
apache-commons-net
jsonpickle
fpml
gnu-smalltalk
commoncrypto
google-cloud-save
opcache
shellexecute
django-nonrel
pushbackinputstream
xamlparseexception
mqx
path-separator
quickdialog
venn-diagram
propertyeditor
qt-jambi
horizontal-accordion
servicehost
iphone-web-app
telerik-scheduler
asp.net-mvc-areas
coda-slider
jquery-ui-droppable
nhibernate.search
compiler-specific
sef
ti-dsp
yagni
phonon
port-number
mediarss





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm