#(BillGates) why dont trades accept maps
54 messages · Page 1 of 1 (latest)
(BillGates) trades accept maps
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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
my english is getting worse everyday, damn i need to get a break from the internet
i'll use this opportunity to link my absolute hack of a script too lmao
https://paste.denizenscript.com/View/103175
Content of Denizen Script Paste #103175: 'Unnamed Denizen Script Paste'... pasted 2022/11/13 18:49:23 UTC-08:00, Paste length: 863 characters across 29 lines
oop, i forgot to ask the main question:
why don't tradetags accept maps?
is this a limitation, or is this a create feature request moment?
(BillGates) why dont trades accept maps
!tag with_property_map
Did you mean to search for propertyholderobject.property_map?
Returns a copy of the object with the MapTag of mechanism adjustments applied.
properties
PropertyHolderObject
that one^
oh shit
wait, uh, i do that with the villager entity?
with the trade object
oh its an actual object, right that makes more sense
!objecttype trade
Merchant trades are the parts of a special merchant inventory that is typically viewed by right clicking
a villager entity. Any number of trades can fit in a single merchant inventory.
Trades are represented by TradeTags.
The properties that can be used to customize a merchant trade are:
result=<item>
inputs=<item>(|<item>)
uses=<number of uses>
max_uses=<maximum number of uses>
has_xp=true/false
For example, the following command opens a virtual merchant inventory with two merchant trades.
...
trade
ElementTag
PropertyHolderObject
The identity format for trades is just the text 'trade'. All other data is specified through properties.
ok, i managed to do it for a single trade
how would i go about multiple trades?
blocktrade_world:
type: world
data:
1:
max_uses: 10000
inputs: iron_ingot
result: end_stone
debug: false
events:
on player right clicks blocktrade:
- ratelimit <player> 1t
- determine passively cancelled
- opentrades <trade[trade].with_map[<script.data_key[data.1]>]>
this works
!c opentrades
player
opentrades [<entity>/<trade>|...] (title:<title>) (players:<player>|...)
Opens the specified villager entity's trading inventory or a list of trades.
Forces a player to open a villager's trading inventory or a virtual trading inventory.
If an entity is specified, only one player can be specified.
Otherwise, if a list of trades is specified, more than one player can be specified.
If the title is not specified, no title will be applied to the virtual trading inventory.
If no player is specified, by default the attached player will be forced to trade.
it's a list of trades
do i gotta do each <trade[trade].with_mapblablabla individually?
yeah
imma try something
prob a bad idea, brb
on player right clicks blocktrade:
- ratelimit <player> 1t
- determine passively cancelled
- repeat <script.data_key[data].size>:
- define trades:->:<trade[trade].with_map[<script.data_key[data.<[value]>]>]>
- opentrades <[trades]>
basically still same idea from the hacky version, but now using with_map
it works, but not too sure if this is the correct way to do it
use a foreach
on player right clicks blocktrade:
- ratelimit <player> 1t
- determine passively cancelled
- foreach <script.data_key[data]> as:val:
- define trades:->:<trade[trade].with_map[<[val]>]>
- opentrades <[trades]>
yeah that feels way cleaner
mark as resolved? idk if theres room to improve