Using /summon slash command to summon a stackable item without quantity parameter causes an error to be thrown. It appears that the quantity value defaults to "0" expecting the summoned entity to be a creature.
π₯ How to reproduce
Steps to reproduce the behavior:
As admin/GM execute /summon <item_name> without quantity parameter.
See console error.
Executed example /summon leather thread:
ERROR [verManager] StackableItem (85 ) Player [deluge, -1335443416] Attributes of Class(): [sourceid=9][quantity=0][x=13][y=15][zoneid=int_ados_town_hall_2][type=summon][creature=leather thread]- Trying to set invalid quantity: 0
java.lang.Throwable
at games.stendhal.server.entity.item.StackableItem.setQuantity(StackableItem.java:85)
at games.stendhal.server.actions.admin.SummonAction$1.found(SummonAction.java:152)
at games.stendhal.server.actions.admin.SummonAction$EntityFactory.createEntity(SummonAction.java:79)
at games.stendhal.server.actions.admin.SummonAction$EntityFactory.access$000(SummonAction.java:53)
at games.stendhal.server.actions.admin.SummonAction.perform(SummonAction.java:177)
at games.stendhal.server.actions.admin.AdministrationAction.onAction(AdministrationAction.java:120)
at games.stendhal.server.actions.CommandCenter.execute(CommandCenter.java:155)
at games.stendhal.server.core.engine.StendhalRPRuleProcessor.execute(StendhalRPRuleProcessor.java:274)
at marauroa.server.game.rp.RPScheduler.visit(RPScheduler.java:113)
at marauroa.server.game.rp.RPServerManager.run(RPServerManager.java:649)
π Environment
Server
π οΈ Suggested fixes
Check if the name of the entity to be summoned is a registered stackable item & set default quantity to 1.
It turns out the server is not at fault. The web client is sending a default value of "0" for "quantity" attribute when it should be leaving it undefined.
π Describe the bug
Using
/summon
slash command to summon a stackable item without quantity parameter causes an error to be thrown. It appears that the quantity value defaults to "0" expecting the summoned entity to be a creature.π₯ How to reproduce
Steps to reproduce the behavior:
/summon <item_name>
without quantity parameter.Executed example
/summon leather thread
:π Environment
π οΈ Suggested fixes
Check if the name of the entity to be summoned is a registered stackable item & set default quantity to 1.It turns out the server is not at fault. The web client is sending a default value of "0" for "quantity" attribute when it should be leaving it undefined.