#(LG_Legacy) Relevant map itemtag mechs and more?

30 messages · Page 1 of 1 (latest)

real pebble
#

Currently I'm trying to replicate loot tables so that I can edit or add more of them for my custom systems, I'm noticing a fair amount of functions in the original lootables that mojang supply such as decoration skip_existing_chunks zoom, along with setting the name of the map with a function called set_name.

I'm not sure what the denizen variant of these are or how to apply them to a map, I will also put forward that I've never really touched maps in-game at all so I'm not fully aware of how they even work besides just displaying an area or showing an X for buried treasure.

rustic condorBOT
#

(LG_Legacy) Relevant map itemtag mechs and more?

rustic condorBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

real pebble
runic umbra
#

!t server.generate_loot_table

drowsy aspenBOT
# runic umbra !t server.generate_loot_table

Returns a list of items from a loot table, given a map of input data.
Required input: id: the loot table ID, location: the location where it's being generated (LocationTag).
Optional inputs: killer: an online player (or player-type NPC) that is looting, entity: a dead entity being looted from (a valid EntityTag instance that is or was spawned in the world),
loot_bonus: the loot bonus level (defaults to -1) as an integer number, luck: the luck potion level (defaults to 0) as a decimal number.

So...

Returns

ListTag(ItemTag)

Examples
- give <server.generate_loot_table[id=chests/spawn_bonus_chest;killer=<player>;location=<player.location>]>
real pebble
#

You want me to just... generate the item from that?

#

I mean it'd work.

runic umbra
#

You can also hook into

#

!e loot generates

drowsy aspenBOT
# runic umbra !e loot generates
Group

World

Event Lines

loot generates

Switches

for:<type> to only process the event if a certain inventory type is receiving loot (like 'for:chest').

Triggers

when loot is generated somewhere in the world (like a vanilla chest being opened for the first time).

Has Player

when the linked entity is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.entity> returns an entity that caused loot generation, if any.
<context.inventory> returns the InventoryTag that loot is generating into.
<context.items> returns a ListTag of the items being generated.
<context.loot_table_id> returns an element indicating the minecraft key for the loot-table that was generated.

Determine

"LOOT:<ListTag(ItemTag)>" to change the list of items that will generate as loot.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

runic umbra
#

if the loot table id matches the shipwreck, determine generated loot table + include denizen items

real pebble
#

I said I'm replicating the system, I was looking for a way to generate maps similar to however the vanilla system is doing. However since it's borderline a 1:1 I'll probably do a choose/case for the type of loot table and use the generate loot table tag.

runic umbra
#

Okay so you want fully custom treasure maps?

real pebble
#

I want to have it replicate the randomness of minecraft generating maps for buried treasure and such. I mean, I don't think I actually need this since I'm hooking onto loot generate event and using that as an id for my custom system and replicating it ( Inserting my own items, etc. )

#

I think the tag you gave me will be what I need.

runic umbra
#

Is the loot table not applied on the chest, rather than the treasure map?

#

If you fully replicate this system, you'd have to set the loot table on the chests location manually

real pebble
#

It'll use the loot table applied to the chest, yes. It's already working on existing loot tables that I have overriden, I just got stuck on this one specifically because of special functions to generate map stuff. But since there is a server tag to pull items from a loot table, then that helps me with the problem.

#

Actually come to think of it I plan to also replicate the villager trades and slot in my own eventually, so this question might be valid of generating treasure maps.

real pebble
#

To anyone asking why I'm basically writing a borderline 1:1 system or replication of the loot system in minecraft, I want full control through denizen rather then touching json files. More importantly I want to replace some existing items with denizen items, or add in my own denizen items without a bunch of else/if and match checkers in the loot generates event.

soft cliff
#

Generating these sort of structure maps are a notoriously laggy thing, as it basically scans the entire world for relevant structure

#

Paper even has settings to entirely disable them iirc

#

But tbh that seems like a bit of an overkill if all your after is easy modification, might be better off having a system to automatically call a procedure based on a loot table id or something like that for example?

#

E.g. clean modification but not an entire overwrite

real pebble
#

I have noticed that it is rather laggy.

#

I think it only pulls the map once which is nice.

#

And you're not going to be doing this back to back.

real pebble
#

But yeah I'm using that tag and thats a solution for now. When it comes to villagers it's going to get interesting.