Posts by Textra

A big new update is now available, introducing biomes, caves and much more!
Latest hotfix: (2024-02-21)

    So, this is me, using your code to create a distance based light level system in order to spawn mobs on the surface at night.

    It's working nicely. :D

    Calm before the storm.

    Nice and safe on the porch.

    A bit less safe outside in the dwindling light.

    Outside in the dark being chased by the undead.

    Hi All. I'm wondering if there is a way to search for objects that are currently existing in the world; e.g. torches, lights, and the like? I'm basically trying to create some rules for the spawning of mobs on the surface and I want to check a position vector for nearby lights to determine if my mob can spawn there. A pseudo light level system if you will. I've looked through the API Javadocs but can't find any obvious method of doing this. I was hoping someone here might know of a way I could achieve this.

    Sorry if this question has already been asked. I searched but couldn't find anything. I wanted to know if Custom Items can be created as Equipment slotted items? I was hoping to take the Backpack plugin example, add a key to open the pack, and add it to the Equipment slot area.

    This is a small plugin that automatically picks up items on the ground around you. There are a few cases of items that won't be picked up by the plugin (guns, API custom items), mostly due to me no being able to find all the required item info to reproduce the item in the inventory; e.g. dropping a gun with 20 rounds gets picked up with zero rounds. I may find a solution to these in the future, or not. ;) In either case, there are some updates* I want to make, so there will be changes coming.

    The code-base is at Github, so you can see exactly how hacky my code is, and also so you can see there are no nasties in it.

    Repo -

    Working Build -

    * Updates Pending

    - Ability to disable if you don't what to auto pickup on a server using the plugin. Maybe something like /ap disable, /ap enable. Added commands; /ap disable & /ap enable

    - A couple of global variables that should really be per player variables need to be fixed. Fixed


    • AutoPickup.7z

      (9.21 kB, downloaded 228 times, last: )

    No worries. :D

    Is there perhaps some way of getting the terrain Y value at specific X,Z values? That's basically what I'm trying to do. If the ray cast won't work, maybe there is another way?

    Edit: Actually I think I have figured another way to do it; a kind of voxel cast. Find the chunk at position X,Z, find the local block coords for the position's X,Z, start at the highest Y value and get the terrain id. If it's air, go down 1 and test the terrain id again. Once it hits not-air, I've probably found the surface. It'll take a bit of finessing to avoid structures and other things, but it might work.

    Hi again. This time I'm trying to spawn some mobs around the player under certain conditions. I'm taking the player's position, adding some random X and Z values, and then using that new position spawnPosition as the starting position for the raycastFromWorldPosition() method. Basically I'm trying to find the ground level Y value so that I can spawn a mob at the spawnPosition vector at the correct terrain height. However, no matter what I use as the starting position vector, it only uses the player's position vector.

    My vectors look good to start with.

    But after the ray cast, the spawn point is off.

    I'm guessing another bug? Or, hopefully, I'm missing something obvious in my code and it can be salvaged. Maybe my direction vector is wrong? Any help would be much appreciated.

    Hey all. So I'm reading the Javadocs and they tell me that the Inventory method insertNewItem() should return null if the new item cannot be added to the player's inventory. However, in my code, the method is returning a non-null item object even when the player's inventory is full and the item gets dropped into the world. Hoping I've missed something obvious and one of you might spot it. Any help would be appreciated.

    Thanks for the responses. Gives me something to work with. :)

    EDIT: So the j3o model loaded just fine, though at size 0.5f it was way too big on screen. lol Adjusting the value helped reign in the model. Not sure how to get it to be one-handed but I'll figure it out. ;)

    Can in-game models for items like pickaxes be accessed in a similar way, so we can use existing item models for custom items without needing to have new model files on the client end? Something like; ModelInformation modelInfo = new ModelInformation( {some path to in-game item model} ).

    I tried something analogous to your GameImageInformation example; i.e. new ModelInformation("Models/Items/Pickaxe/pickaxe_modern.j3o") but that didn't work server side.

    I hate to necro this thread but I could use some advice.

    I'm following the readme on GitHub page for this plugin but there are a couple of steps that confuse me.

    1. After cloning the repo into the /srv/apps/ folder, there is a step that says to navigate to the oz_rw_risingmap_backend folder and run cp config/config.default.json config/config.json;. However, there is no such folder config nor any files for config.json or config.default.json in the repository. Should these files be part of the repo?

    2. In later steps the instructions say to run tsc and then run node bin/main to test the build. Should the tsc command create the bin/main folder and file? I'm not seeing the folder or file after running tsc.

    Any help anyone could give would be much appreciated. :)