MineRealm Community It is currently Thu Sep 19, 2019 5:42 pm

 [ 37 posts ]  Go to page 1, 2, 3, 4  Next
 [IMPLEMENTED] Extend private plot protection to passive mobs 

Do you support this idea?
Yes 77%  77%  [ 30 ]
No 23%  23%  [ 9 ]
Total votes : 39

 [IMPLEMENTED] Extend private plot protection to passive mobs 
Author Message
User avatar

Joined:   Oct 26, 2011
Posts:   551

Verified IGN:
jeniansmom

User Reputation:  
2/10


Reply with quote
Post [IMPLEMENTED] Extend private plot protection to passive mobs
Only players who are members of a private plot would be able to interact with a passive mob on that plot. (Could breed it, feed it, milk it, saddle it, kill it, etc.)
If a passive mob left the plot it would lose the protection.
Sat Mar 15, 2014 10:19 pm
Profile
Site Admin
User avatar

Joined:   Feb 5, 2011
Posts:   4,435
Location:   Lycopolis

Verified IGN:
Rokkrwolf

User Reputation:  
4/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
I'm rather curious how this could even be possibly implemented as it has never been done before/probably can't be done as far as I am aware.

_________________
Please support the threads linked below ;)

Sun Mar 16, 2014 12:17 am
Profile
User avatar

Joined:   Jan 10, 2013
Posts:   1,375
Location:   STRAYA!

Verified IGN:
Bu1ld0g

User Reputation:  
5/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
I know it's probably completely different coding but a local Aussie server uses essentials and a few others I'm unsure about, MCMMO etc.
But their plugins include mobs being protected by precious stones that cover a set radius rendering any mob within private. So I'm guessing it could be similar in coding theory.

No hiding mobs in nuclear bunkers there ;)

Oh, also named horses are protected anywhere there if it makes a difference.

_________________
Image
Sun Mar 16, 2014 2:33 am
Profile
User avatar

Joined:   Oct 26, 2011
Posts:   551

Verified IGN:
jeniansmom

User Reputation:  
2/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
Rokkrwolf312 wrote:
I'm rather curious how this could even be possibly implemented as it has never been done before/probably can't be done as far as I am aware.


Not being a programmer, I'm not sure about that either, Rokkr. But Intelli does a lot of things with coding that make me go "whaaat?...how?...that's so cool!" so I have faith that if anyone can do it, he can. Also, it seems like it might be possible due to the fact that coreprotect can log who killed a mob and roll it back.
Sun Mar 16, 2014 4:54 am
Profile
User avatar

Joined:   Aug 13, 2012
Posts:   1,924
Location:   WOGS HQ

Verified IGN:
0820497

User Reputation:  
0/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
I like killing other peoples animals as well as sneaking into their sheep farms and getting wool.
-1
Sun Mar 16, 2014 5:31 am
Profile
User avatar

Joined:   Sep 26, 2012
Posts:   1,804
Location:   Where am I?

Verified IGN:
cubeguy314

User Reputation:  
4/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
I like it. If a mob is unsecured in a private realm, you can still use a lead to take it out of the realm.

_________________
Image
Sun Mar 16, 2014 5:47 am
Profile

Joined:   Aug 29, 2011
Posts:   1,954
Location:   The Milkyway

Verified IGN:
eah

User Reputation:  
7/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
Firstly, I need to mention that if this goes through, something needs to be done about wolves since they're potential attackers and weapons in pvp. That is, they need to be damageable at least with pvp on.

https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/player/PlayerEvent.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/Cancellable.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/entity/Entity.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/entity/HumanEntity.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/Location.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/entity/ProjectileLaunchEvent.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
https://github.com/Bukkit/Bukkit-JavaDoc/blob/master/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java

Do some entity handling hoodoo with PlayerInteractEntityEvent. Get the entity the player is interacting with. If it is a passive mob and the passive mob is in a private plot that the player does not have permissions in, cancel the event.

For stuff like snowballs, eggs, fishing hooks, and arrows (all projectiles), I kinda doubt these count as PlayerInteractEntityEvent. So you need to handle DamageByEntityEvent and its parent, EntityDamageEvent. Luckily, these keep track of who launched the projectile. If the damaged entity is a passive mob and this passive mob is in a private plot that the projectile's shooter does not have permissions in, cancel the event.

If you want, you could also try assigning the plot owner to the shooter of a projectile released from a dispenser since projectiles shot from these are born without a shooter. Use ProjectileLaunchEvent. Reason for doing this is to stop people from using dispensers and arrows to circumvent animal protection.

The reason this is not yet implemented is likely not due to the impossibility or difficulty.

_________________
Image
Sun Mar 16, 2014 5:50 am
Profile
User avatar

Joined:   Oct 26, 2011
Posts:   551

Verified IGN:
jeniansmom

User Reputation:  
2/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
eah2119 wrote:
WONDERFULLY GEEKY STUFF
:D

also:

eah2119 wrote:
Firstly, I need to mention that if this goes through, something needs to be done about wolves since they're potential attackers and weapons in pvp. That is, they need to be damageable at least with pvp on.


Yes, should be strictly passive mobs.

Excerpted from: http://minecraft.gamepedia.com/Mobs#Passive_mobs :

Passive mobs
Passive mobs will not attack the player under any circumstances. This category includes most of the "farm animals" present in the game, which can be bred for food and/or other resources. Also included are bats and squid, both of which have special spawning conditions and cannot be bred. Ocelots are technically passive, in that they will not attack the player, but they are actually coded as hostile mobs.
Sun Mar 16, 2014 5:57 am
Profile

Joined:   Aug 29, 2011
Posts:   1,954
Location:   The Milkyway

Verified IGN:
eah

User Reputation:  
7/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
The reason I mentioned wolves is because they're grouped with the rest of the animals (sheep, horses, ocelots, etc) in the code. Can't simply check whether it's in the animal group. Need to check whether it's a wolf as well. Also, I forgot to mention villagers. They're not in the animals group, but should still be protected.

_________________
Image
Sun Mar 16, 2014 6:11 am
Profile

Joined:   Jan 23, 2013
Posts:   29

Verified IGN:
AegisMN

User Reputation:  
0/10


Reply with quote
Post Re: Idea: Extend private plot protection to passive mobs
Everything from chests to blocks of dirt are protected on claimed land. Every form of theft and destruction on someone else's land is against the rules. Animals/Mobs should be no different.
Sun Mar 16, 2014 6:31 am
Profile
Display posts from previous:  Sort by  
Post new topic Post new reply  [ 37 posts ]  Go to page 1, 2, 3, 4  Next


Who is online

Users browsing this forum: No registered users and 2 guests