1. Trying to use the shop? Use /shop tutorial in-game for a quick overview. Visit here for a command overview.

Petexchange

Discussion in 'TimGaming Development' started by Fahlur, Mar 12, 2016.

  1. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    [IMG]


    A simple plugin project, this allows you to trade your pet with another player! Great for player shops that wish to sell their pet!

    How would this work?

    Planned setup: It would be simple as the following steps
    1. Type the command /setowner <playerName>
    2. Then Right click the pet you wish to set the new owner
    3. That's it!
    To check owner
    1. Type the command /checkowner
    2. Right click pet
    3. That's it!
    What animals work with this?
    All tamable pets. This means Regular Horses, Donkeys, Mules, Ocelots, Wolves.

    Wait regular horses, what about skeleton horses?
    Skeleton horses are NOT tamable in 1.9. The moment a skeletal trap is activated the lighting strike gives the horse a owner uuid of the skeletal rider. Which means they are already tamed. I will make a ceasing solution for this later on
    *UPDATE* Added capability to claim skeleton horses to own them and exchange them!


    This plugin is pretty much done, just waiting on for more ideas for it before cleaning it up and going to proposal as a feature for TG



    MarvinTheRobot likes this.
  2. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Alright guys the 2 main functions, setting the owner and checking for the owner is done! I had to change how its done but meh it works now! Please by all means provide ideas for this plugin before I GOLD it and push it as a dev project for timgaming and hope tims accepts it.. *phew* lol
  3. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Note of potential issue:
    Skeletal Horses are not tamable. Let me define what I mean on this.
    When a player approach a trapped skeletal horse, a skeletal horsemen spawned, 4 of them actually. After you kill the horseman the horse is ride-able from the start. This means the skeletal horse is already tamed by the horseman. Which leaves 1 issue. You are not able to set a new owner for the skeletal horse, as well as I am currently unable to have regions that are not yours allow you on the skeletal horse because in a sense minecraft says its not yours. I will work on a remedy to this, maybe if the horse doesn't have a players owner id that it will update to the first rider as the tamed rider. This way the skeletal horse becomes "yours".

    I haven't dug alot into the potential issue with skeletal horses as of yet, this thought just came to mind on how Mojang treated how skeletal horses are already tamed when the horsemen spawn. I will re-update this post with further information when im able to confirm some more things and see what I can do to well "fix" in a sense the things that are the issue for petExchange and the WGTweaks for pet ownership.

    EDIT: Update
    Was able to confirm that the skeletal horse is tamed upon lighting strike when the trap activates and is not tamable but is rideable by the player.

    Update 2
    Well ill look into a solution for this after my pc's running again. ATM it puts the uuid of the skeleton rider as its owner sadly. So sell/trade/give to players and make them the owner via petExchange wont work on them atm. (since your not really the owner)
  4. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Alright to point out to do this with skele horses I would have to do the following

    check if they are tamed, if so whos the owner. if its a non player uuid e.g. the horsemen then i need to clear it and untame it, then the player can tame it or is the owner, whichever the setup needs.

    Essentially,

    If skele horse is owned by horsemen
    Untame, remove that horsemen as owner, then allow player to tame.

    ideas on vanilla sides of things players would have to do to tame it (initiate this process and be the owner of it).

    Note: Do not worry about protection related things this will be handled appropiatly


    Maybe one of the following methods of claiming

    1.) Give it a bone and 1/5 chance it tames to you (shows hearts, otherwise little smoke cloud)
    2.) Attempt to ride it and its programmed to rear you off by the plugin if it doesn't tame within a % chance.
    3.) /claim , then right click unclaimed skeleton horse (if its claimed it alerts you already claimed)

    Personally I like the concept of #2. #3 eh its alright but not everyone will know this.
    If they aren't player tame (they are undead horsemen tamed) then have it switch uuid of owner to yours and done.

    Of course the plugin will have to check the owner uuid on the horse and see if its an existing player, it seems to be potentially random or in fact the horsemen. Either way they are not player tamed. So it would check if its a player uuid, if not a players then it continues with claiming otherwise it wont let you.
  5. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    There is now a GitHub Repository for PetExchange (only so much can be done without my pc XD)

    Did have a copy of the plugin and some other info on a flash drive >:}

    https://github.com/fahlur/PetExchange
  6. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Okay guys, when I remove the tamed option for the skeletal horse they are no longer ride-able. meaning if they are not tamed they aren't ride-able. So to tame it to the player im going to ... sigh .... simulate a normal horse taming process so it can be tamed to a player rather than to "no one"


    EDIT:
    I have made a solution and sticking to it.

    When you find a skeleton horse if you attempt to ride it, youll will be given one of the following messages

    This Skeleton Horse does not accept you as its master!
    This Skeleton Horse has accepted you as its master!

    This is a 1/5 chance of taming the horse to you. I added sounds for each but will be adding more such as particles (similar to a horses taming process) and try to look into kicking the player off as well.

    Now it will not attempt to tame if the skeleton horse was already tamed. This whole thing will allow players to /setowner <player> their tamed skeletal horse to another player as the owner. (trade pets essentially, whether be free or sold :p)
  7. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    TO DO:
    • (WIP) Make it more obvious the skeleton horse hates you if it didn't accept you (lol)
    • (DONE) Make it so if your not the owner of the mule/donkey that you cant access saddled chests
    • (DONE) Make it so if your not the owner of the horse/mule/donkey you cant access its inventory at all
    • (DONE) Disallow players to mount horse that are not theirs
    • (DONE kinda) Figure way to allow players to mount their OWN horses in other protections (so they dont lose their horse)
    • Make Op Override perms to allow anyone with the override permission to mount any horse as well as a override perm to allow those with that perm to change owners of any horse.
    For the Allow players to access their own horses and not non owners the following is required for world guard

    /rg flag __global__ ride allow

    Players owned horses are protected by the PetExchange plugin as long as they are the vanilla owner of the horse. This now includes skeleton horses. However baby horses are not necessarily protected so its good practice to tame asap.

    I am working on a better method that does not require the need to set that flag.
  8. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Well bugger all, there's no way in world guard to be overridden. They made their own event for checks and did not put in a cancellable so I can actually well cancel the event from canceling...

    Well for now for world guard the only solution is

    /rg flag __global__ ride allow

    this plugin will protect all owned horses from being stolen (this does NOT include babies, but babies cant be ridden away until they are untamed adults). Working on way to protect unclaimed horses in protection.

    of course everything will be configurable :)

    for the time being
  9. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Commands:

    /checkowner : check owner of pet (if there is a owner otherwise it will say its not tamed)

    /setowner <playerName> : Allows you to give your pet to another player that's online


    New Commands: These are special admin commands

    /tame <playerName> : Allows the person with permission to instantly tame an untamed pet to anyone they choose without the hassle of trying to tame through vanilla means.

    /untame : Allows the person with permission to remove ownership of any tamed animal making them a tamable animal again.

    Added admin override permission node to use the 2 new commands and to override transfer any pet to anyone


    Known issues:
    • Currently if the /tame command is used on ocelots they will remain an ocelot and not turn into a special breed. They will follow you like any other cat just wont change skins. TBH I might leave it this way and add commands to change the breed of all pets.
      • Fixed it so when you /tame an animal it randomly picks 1 of the cat breeds.
    • Attempting to lead a baby horse will cause the player to ride them instead to lead. (This doesn't happen if you shift right click)
    • ....
  10. SomeRandomPyro Distinguished Member

    Minecraft Username:
    somerandompyro
    Suggestion: Pet selling integrated. Something like:

    /setowner <playername> [price]

    Upon right-clicking the creature,
    If price is left blank, plugin proceeds as already stated.
    If price is a positive number, prompt <playername>, something like:
    <Original Owner> wishes to sell you <creature type> for <price>.
    To purchase, /pxaccept, to decline /pxdeny
  11. Fahlur Exalted Member

    Minecraft Username:
    Fahlur

    I rather like that idea. I will look into this asap. Also will be posting up another project involving hardcore worlds and such :) ... :O shhhh

    Welp still got to add more protection stuff anyways, such as keeping other players from killing your tamed pet/horse outside your protection area
  12. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    This is the list I am working on with protecting players tamed animals in pet Exchange, Everything in GREEN is complete,

    Note: this is protecting the tamed animal from other players, not from yourself, mobs or natural causes.
    • Melee Damage
    • Normal Arrows (It will bounce off mob, watch out!)
    • All Tipped Arrows (It will bounce off mob, watch out!)
    • SnowBalls
    • Eggs
  13. MarvinTheRobot Paranoid Android

    Minecraft Username:
    MarvinTheRobot
    Would it be possible to add a flag that allows owners of the region to kill animals within that region, even if the protection owner is not the owner of the animal?

    ... or make that the default setting.
  14. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Lets see if I get this right by using this...

    Animal In Question: Horse
    Horse Owner: Alex
    A Protection Owner: Zack

    If Alex leaves his Horse in Zacks protection. While the Horse is in Zacks protection, Zack can kill set Horse left by Alex?

    If so then I could add world guard support just in general. Hate putting reliance on other plugins, but sure. I can add the support and just make that configurable.
  15. MarvinTheRobot Paranoid Android

    Minecraft Username:
    MarvinTheRobot
    Yep, I've had issues with random skeleton horses that someone (I think) has accidentally right clicked and that are now roaming around and cannot be killed.
    I know that other people have had the same issue, because I was asked if I could kill a skeleton horse for them (which I could not).
  16. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Lingering Potions Will kill them, and I do believe lava to. as well as fire.

    For the moment I would use one of those methods.


    Or if you have perms, do /untame them right click it, then kill it (if you have /untame of course)
  17. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Added/Updated the following protection methods

    Your Tamed Horse/Mule/Cat/Dog cannot be harmed by the following sources.
    • Physical Attacks (by other players or mobs)
    • Splash potions (by other players or mobs or dispensers)
    • Any Damaging Lingering Potion Effects (with the exception of poison)
    • Any Projectile Attacks (by other players or mobs or dispensers)
    Anyone with the following perm node 100% ignores the above (with the exception of lingering potions)
    • pe.petProtectionOverride
  18. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    1.3.0 Update Notes: This is a W.I.P., please read notes thoroughly.

    Current Known Issues To Be Resolved:
    • For some reason /horsestats will have issues with players that are not the owner of a horse on timgaming, unable to recreate on testing server. Perhaps out of date ver on timgaming? Will find out with this update!
    Bug / Issue Tracker:
    • [FIXED] Issue with shulker projectiles not effecting players
    • [IN TESTING] Issue where /horsestats does nothing for players that dont own the checked horse, but leaves stack trace error in console
      • Unable to recreate in testing server, only on timgaming. Perhaps out of date version on timgaming?
  19. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Updates: as of 05/16/17 @ 02:10 PM CST

    + Fixed issue with petexchange not interacting with mules and donkies, they can now work with all petExchange commands and protections and such. (this was due to the changes mojang made to mules and donkies and such)
    + Unable to fix issue with sit wolves in protected areas and not being able to unsit. Unable to recreate this issue anyways but world guard takes over and prevents me from any form of forcing the wolf/ocelot to unsit and sit on the OWNERS designation


    PLEASE NOTE: These changes are not immediate on the server! To find out if the latest version of the plugin is on the server use the version command of that plugin!

    Command: /pe or /petexchange
    Latest Version: 1.4.0
  20. Fahlur Exalted Member

    Minecraft Username:
    Fahlur
    Made it so you can no unsit/sit your wolf/ocelot/parrot in other protections that your not on. Now if your pet is for some reason sitting in another protection you can unsit it!

    This is all in the latest version that's currently on dev server
    MarvinTheRobot likes this.

Share This Page