Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-05-05 04:24:29

1448
Formerly alkazam1448
From: Numberland
Joined: 2015-04-12
Posts: 683
Website

Finding block pos

This is kinda stupid but how do you check if a player is near a block? I wanna make a digbot.
All that a digbot does is check if a player is near a block. So how do you do that? Save a "b"? What if the block was placed before the bot came in?

Offline

#2 2015-05-05 10:14:17

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Finding block pos

In the init message you receive WorldData, which contains all the blocks that are pressent when the bot joins the room.
Problem is that the worlddate is serialized and you don't just get all the data the easy way: you'll have to deserialize it.
here you can find an example of a worlddata deserializer with explenation on how to use it.

Offline

#3 2015-05-05 11:45:12

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: Finding block pos

In addition to what den said about worlddata,
you have to update the worlddata whenever a block is placed.
Afterwards, make a player class and make it update whenever a player moves so you can check if they move near a block.

Offline

DarkDragon49001430822712501562

Board footer

Powered by FluxBB

[ Started around 1732476605.038 - Generated in 0.165 seconds, 11 queries executed - Memory usage: 1.38 MiB (Peak: 1.49 MiB) ]