Started by
Osmith
on
Topic category: Help with Minecraft modding (Java Edition)
i want to create a death note-like item, when you type the name of a player in the gui and click a button he die, everything i tried won't work, can someone help me?
im trying to do this too..
I already did it. It's actually pretty easy to do :D
You just have to get the text from an InputBox called "EnterName" (you have to create one) inside the GUI.
Every time you close the GUI / click on a button, it'll just execute the following procedure blocks:
[ Execute command / [ create text with: /kill @e[name=" + [ Get text inside textfield "EnterName" ] + "] ] in the name of Event/target entity ]
To make it much more realistic you can add a potion effect called "Death".
As you type in the name, the target will receive the potion effect.
After the effect expired, the target will die.
[ Execute command / [ create text with: /effect give @e[name=" + [ Get text inside textfield "EnterName" ] + "] <your_mod_id>:death 40 6 true ] in the name of Event/target entity ]
I even added a gamerule called "EnableDeathNote",
which case it'll only work if its value is true.
:D
I've Tryed what you say ([ Execute command / [ create text with: /kill @e[name=" + [ Get text inside textfield "EnterName" ] + "] ] in the name of Event/target entity ]),
but I can't use a "+" to sum the text of "/kill @e[type=" and the name.
What can i do?
PD: I'm spanish so my english is not the best
Use the Create Text From block
Create Text From:
i have serached the Create Texet From block for a while and i do not find it.
(im in 2020.2 version)
It definitely exists in that version
Its in the Text tab when you are editing a procedure
I have tryed and i only can put two blocks in the "create text from".
Also I have tryed to put only two blocks of text (the /kill @e[name=" and the text input puting a * "] * in the end and does not work.
thanks to AtomiX7_NG34, the procedure works perfectly
Else, hit the gear icon on the block to add for slots