Generating Apple like fruit

Post Reply
User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Generating Apple like fruit

by rubenwardy » Post

Can someone point me in the direction on how to use the map generator to register orange trees.

I am making a server-safe, low cpu food mod.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

i think apples only grow from planted saplings.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

This almost looks like it, but it is on drop

Code: Select all

minetest.register_node("default:leaves", {
    description = "Leaves",
    drawtype = "allfaces_optional",
    visual_scale = 1.3,
    tiles = {"default_leaves.png"},
    paramtype = "light",
    groups = {snappy=3, leafdecay=3, flammable=2},
    drop = {
        max_items = 1,
        items = {
            {
                -- player will get sapling with 1/20 chance
                items = {'default:sapling'},
                rarity = 20,
            },
            {
                -- player will get leaves only if he get no saplings,
                -- this is because max_items is 1
                items = {'default:leaves'},
            }
        }
    },
    sounds = default.node_sound_leaves_defaults(),
})
Last edited by rubenwardy on Mon Aug 13, 2012 17:08, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

no, thats for normal leaves (you get a chance at getting a sapling).

I had a look through the LUA code and I cant see where it generates an apple tree. I know it happens with a % chance after planting a sapling when it turns into a tree.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post


Pixet Bits
New member
Posts: 2
Joined: Fri May 15, 2020 20:43
GitHub: PixetBits
IRC: PixetBits
In-game: PixetBits

Re: Generating Apple like fruit

by Pixet Bits » Post


User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Generating Apple like fruit

by v-rob » Post

Erm, this post is from waaaaay back in 2012. Check the post date before posting anything because the problem is either solved or moot at this point.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests