Comments (5)
Looks like array_implode does the same as well. (Returns the array, not a string)
from commandhelper.
assign(@Items, array(parse_args($)))
should be
assign(@Items, parse_args($))
parse_args() returns an array, no need to array() it.
from commandhelper.
Try this... http://paste.thezomg.com/1786/13314019/
Type /test a b c
You will get:
Items: {{a, b, c}}
Items 0: {a, b, c}
First: {a, b, c}
Items: {a, b, c}
Items 0: a
First: a
Explanation... because parse_args() returns an array, by using array() around parse_args() you effectively turn @Items into an array of arrays. You can see this because of the double parenthesis around {{a, b, c}}. {a, b, c} is the first (and only) item in the @Items array. Think of it like this: {{a, b, c}, {d, e, f}, {g, h, i}}. This is actually a great way to store coordinate arrays... For example I have a script where you can /enablesigns (Basically make it so a sign can do something if there is a command on it)... To do that, I push the location of the sign onto an array, but the location itself is an array (In the format {x, y, z, World})... So I get an array that looks like {{x1, y1, z1, World}, {x2, y2, z2, World}, ... }
from commandhelper.
So, I'm a bit confused now, this is not a bug, correct? After looking at @Rebes script, it appears to be working as intended.
from commandhelper.
I... uh. Yea. Closing =D
from commandhelper.
Related Issues (20)
- Core exception when using stop_named_sound
- Provide schema for Persistence Network
- Provide `nocatch` keyword HOT 4
- ba_get_bytes() (always?) returns a zero-size byte_array
- [Feature request] has_inventory
- pfacing resets player velocity to 0 HOT 2
- entity_spec and set_entity_spec do not have support for InLove
- Possible EOFException in SerializedPersistence during recompile HOT 2
- add support for tools/items in break_block
- [BUG] set_pinv(pinv()) clears BlockStateTag values
- item_swap event docs don't match actual behavior HOT 1
- set_pinv(pinv()) clears EntityTag values HOT 3
- False BlockState default values (also enforced after set_pinv(pinv()) ) HOT 1
- Using switch_ic the break() function gives a compile error HOT 1
- [Feature request] InventoryPickupItemEvent and InventoryMoveItemEvent
- Errors with persistence can leak DB password in error messages
- Using unexisting functions in `foreach(... in ...) {}` syntax results in unexpected additional compile errors
- [Feature request] colorize() to support hex colors HOT 11
- "@var was already defined" runtime error on typed foreach loop variable HOT 1
- Improve handling of offline players during events HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commandhelper.