(01-17-2012, 21:05)yottabyte Wrote: The Bukkit API makes handling living entities much simpler though afaik. Just use like setTarget(Player) and all that good stuff.
Oh, that's much simpler, I've never actually written a plugin before so I have no idea if I will be able to do anything with it but it is so much more straightforward than modifying whatever notch has written. Although I really know nothing about how to make it work intuitively (link a toggle in the targeting of the wolf to the opening of a nearby door) but I suppose that's what thinking is for.
I think in a pseudo coding sense:
Code:
10 Get Nearby Entities within 10 blocks
15 If one or more of those Entities is a player then
20 Check if player is wolf owner for each player
25 If true for all players
30 goto 10
40 Else SetTarget(Nearest non-owner player)
50 Else goto 10
To trigger the code could involve feeding a wolf something special (iron or apples etc) to start the "Guard mode" function for a tamed wolf.
No idea if that makes any sense though....