sounds silly

Discussion in 'Plugin Development' started by kamakarzy, May 8, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    kamakarzy

    how can i make it so i could plant a bone
     
  2. Offline

    kreashenz

    You can't 'plant' a bone. Explain more on what you mean? Like plant it as in plant it like a sapling?
     
  3. Offline

    kamakarzy

    yes there was a plugin called appleseed where you could plant an item and it grows a tree and drops that item however i just want to know how to be able to plant a bone
     
  4. Offline

    kreashenz

    No idea. If you're replying to me, make sure you click the 'Tahg' button.
     
  5. Offline

    kamakarzy

    kreashenz yes i was replying to you sorry
     
  6. Offline

    TheTinySpider

    kamakarzy this plugin you mean? I've looked at it and it seems to just look for a nearby sign and edits the leaf drops.
     
  7. Offline

    kamakarzy

    TheTinySpider yes thats the one im on about but look

    Features:

    • Plant items in soil(aka farmland) and grow a tree that drops that item on the ground
    • Config file that controls allowed types of trees, item drop interval, and the need for fertilizer
    • Permissions to control who can plant trees(and what type)

    could anyone help if there is an easier way as of right now im pulling a player rightclick event on soil and then making the item dissaper. I really need to know 3 things ive looked and searched but can not find help
    1. easy way for a planting event
    2. or making my way sprout a stalk
    3. also the event that makes the sprout turn to a full grown tree
    sorry im trying to make a silly plugin where you plant raw pork or raw beef and it grows a baby pig or cow dont ask why its a request

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  8. Offline

    Jamie Marks

    this a complicated one, If you were to right click the grass with a bone you could create a tree, (make a structure like a tree) add all of its leave locations to a HashMap or something, then when they despawn ( there's an event for this i don't remember its name though) check if the despawning leaf's location is in your map and if it is make it have a random chance of spawning the object you right clicked with, I would recommend adding the name of the item to the hash as its name, map.put(""+item.getId(),co-ords) or something its gonna take you some time but its highly possible.
     
  9. Offline

    kamakarzy

    Jamie Marks like i said im actually trying to take away the tree. eg. i plant a raw porkchop and after the same amount of time as it takes to grow a tree and it grows a pig :)
     
  10. Offline

    Jamie Marks

    ahh.. i see what you mean Ok heres what your gonna want to do. right click ground make the block at the world a sapling, add that saplings location to a HashMap then when the tree tries to grow cancel it set the block to air and create a pig, then remove the location from the map. only issue with hashmaps is that on reloading the server the sapling will no longer know its special and will grow a normal tree. you could add these to a config type file though.

    theres many tuts on making custom configs and theres many tuts on hashmaps if you dont know.

    also tree grow event = StructureGrowEvent hope i helped.
     
  11. Offline

    kamakarzy

    Jamie Marks kk ill give it a try thanks meanwhile if you find an easier way please let me know
     
  12. Offline

    Jamie Marks

    that seems the easiest way to me. have fun messing with it :p
     
Thread Status:
Not open for further replies.

Share This Page