Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val test = "{AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,Air:300s,AngerTime:0,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Attributes:[{Base:20.0d,Name:\"minecraft:generic.max_health\"},{Base:0.30000001192092896d,Name:\"minecraft:generic.movement_speed\"},{Base:16.0d,Modifiers:[{Amount:0.00845283713794214d,Name:\"Random spawn bonus\",Operation:1,UUID:[I;735237967,1661486231,-1128333060,1912133126]}],Name:\"minecraft:generic.follow_range\"},{Base:4.0d,Name:\"minecraft:generic.attack_damage\"}],Brain:{memories:{}},Bukkit.Aware:1b,Bukkit.updateLevel:2,CanPickUpLoot:0b,CollarColor:14b,DeathTime:0s,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:20.0f,HurtByTimestamp:0,HurtTime:0s,InLove:0,Invulnerable:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],OnGround:1b,Owner:[I;1753507694,766262610,-1445118675,-783976364],Paper.Origin:[-135.5d,83.0d,-113.5d],Paper.OriginWorld:[I;-1967849511,-549632151,-1135486253,-254840820],Paper.SpawnReason:\"SPAWNER_EGG\",PersistenceRequired:1b,PortalCooldown:0,Pos:[-141.91046572260117d,81.0d,-110.60681626963152d],Rotation:[263.65125f,-20.0f],Sitting:1b,Spigot.ticksLived:5835,UUID:[I;561218244,1140674401,-2098431378,-1032690743],WorldUUIDLeast:-4876876317652455412L,WorldUUIDMost:-8451849289449257111L,id:\"minecraft:wolf\"}"
- command("deserialize"){
- execute<Player> { sender, _, _ ->
- val world = Bukkit.getWorld("world")
- if (world == null){
- info("world is null")
- return@execute
- }
- val entity = SerializeEntity.getEntityFromNBT(test, world)
- if (entity == null){
- info("entity is null")
- return@execute
- }
- entity.teleport(sender)
- info(entity.name)
- info(entity.isDead)
- info(entity.location)
- info(entity.uniqueId)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment