Minecraft PC IP: play.cubecraft.net

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,165
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,165
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

Team online

Latest profile posts

qKhalidd wrote on Mivke's profile.
happy birthday!
Eli
Did anyone else play Skylanders? I recently got it to work on my PC with a PS3 emulator and it's more fun than I remembered!!
Eli wrote on SanderVDB29's profile.
Happy Birthday!!!
Eli wrote on Mivke's profile.
Happy Birthday!!
GiGaGekkies wrote on SanderVDB29's profile.
Happy Birthday!
Top Bottom