Minecraft PC IP: play.cubecraft.net
  • We're running an internal migration of all old players' stats to our new highly advanced statistics tracking backend. This means that stat changes will be a bit delayed while we ingest this huge backlog of data. Nothing is being lost, it'll just take a bit longer to show up in the in-game UIs.

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
518
Kepler-452b
Code:
 public void spawnPerPlayerWorldBorder(int size, Player p, Location loc){
WorldBorder wb = new WorldBorder();
 PlayerConnection pc = ((CraftPlayer) p).getHandle().playerConnection;
            wb.setSize(size);
            wb.world = ((CraftWorld) p.getWorld()).getHandle();
            wb.setCenter(loc.getX(), loc.getZ());

            PacketPlayOutWorldBorder wbp = new PacketPlayOutWorldBorder(wb, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE);
            pc.sendPacket(wbp);
}

here's the result
unknown.png

Extra points for whoever spots a mistake
nms cool
 
Last edited:
D

Deleted member 294498

Guest
/worldborder set ...
That's a thing ;d

But I know that if I do your way it wont be in the zero coordinates :P
 

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
518
Kepler-452b
/worldborder set ...
That's a thing ;d

But I know that if I do your way it wont be in the zero coordinates :p
Not really ;). Its equivalent would be:
Code:
WorldBorder worldborder = world.getWorldBorder();
Worldborder.setCenter(X, Z);
Worldborder.setSize(size);
Which sets the “global” world border. The code above creates a “fake” world border limited to the client that receives the packet (hence the PlayerConnection), meaning that if you and I are on the same server and I performed a command (an action or whatever) that calls the above method, I’d see a worldborder with the center on X location (where loc is, can be player, or whatever) with Y size. You wouldn’t see it. However, the normal worldborder conditions apply, so I can‘t cross it (but you can), etc
 
Last edited:

Dronade

Novice Member
Dec 16, 2019
38
211
39
Wales, UK
I dont do command blocks, not my job lmao. Mine is scripting of custom entities, so programming in JSON to be specific. #jsforthewin

I mostly hate java cause of its syntax and the fact ive had to code in it for 6 months straight for university :(((
 
  • Like
Reactions: DrHam

Dronade

Novice Member
Dec 16, 2019
38
211
39
Wales, UK
More as in, wdym by programming in JSON, its just object storage


Ts is js on steroids :cool:

Techically yeah i dont really 'program' in json, i mostly just say it as a simplification of what i do. I use a combination of js and data driven entity creation which is compiled to json but its much easier to just say that when they ask what i do.

True ts is better than js in a lot of cases, but ts isnt industry standard so enjoy finding a use for it anywhere except a personal project, so theres that.
Tho i suspect in a few years that statement will change but for now js > ts
 
Members Online

Latest posts

Latest profile posts

LemonyBreak459! wrote on iTz1Hamood's profile.
Good luck for ur Life
And Thanks for being a Friend and the MOD !
AliWarrior wrote on iTz1Hamood's profile.
Thank you for everything and best of luck in your life!
kevin020007 wrote on iTz1Hamood's profile.
Dear Hamood, Thank you for being an amazing friend for me during my cubecraft time with you and your time as bedrock cubecraft moderator and upcoming java cubecraft moderator. Thank you for helping the ccl staff with hosting and the community by hosting pg's and thank you for the great time we had together. I hope to see you back sooner on the battlefield then I can imagine. We love you hamood❤️❤️
Red crits wrote on iTz1Hamood's profile.
Hey Hamood, you were a wonderful team member. Wish you the very best for your future endeavors:) see ya around!
ItzJuan wrote on iTz1Hamood's profile.
Onward with life, good luck from now on!
Top Bottom