Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

'GUI' can't be used when creating a gui #34

Closed
HYPExMon5ter opened this issue Dec 30, 2017 · 15 comments
Closed

'GUI' can't be used when creating a gui #34

HYPExMon5ter opened this issue Dec 30, 2017 · 15 comments

Comments

@HYPExMon5ter
Copy link
Contributor

Error: image

Code:

command /bug:
	trigger:
		create a gui with virtual chest with 2 rows named "TuSKe Bug":
			make gui slot 1, 3, 10, 11, 12, 19, 28, 36, 37, 45, 46, 52 and 53 with black stained glass pane named "&0"
			if slot 1 of gui is dirt:
				make gui slot 1 with grass
			else:
				make gui slot 1 with diamond block
		open last created gui to player
@HYPExMon5ter HYPExMon5ter changed the title GUI can't be used when creating a gui 'GUI' can't be used when creating a gui Dec 30, 2017
@Blueyescat
Copy link

Just read the error message, you can't use gui outside of make gui.

make gui slot 1, 3, 10, 11, 12, 19, 28, 36, 37, 45, 46, 52 and 53 with black stained glass pane named "&0":
	if slot 1 of gui is dirt:
		make gui slot 1 with grass
	else:
		make gui slot 1 with diamond block

@HYPExMon5ter
Copy link
Contributor Author

I did, I was asked by tuke to make an issue though

@Blueyescat
Copy link

Blueyescat commented Dec 30, 2017

I can't see purpose on using gui in create gui section.

@HYPExMon5ter
Copy link
Contributor Author

to get the inventory of the gui you're creating??

@Blueyescat
Copy link

Blueyescat commented Dec 30, 2017

Why you would want that lol. But did you try to use gui "id" or last gui? If you aren't able to use them, then the same for gui. I needs to create the expression and edit it instantly before end of the create gui section.

@HYPExMon5ter
Copy link
Contributor Author

making a slot stealable without having to have on on inventory open or conditionals, like i provided in the code above, etc., there are quite a few uses. and I'm not gonna create a gui with a id if it's not gonna stay the same or close to it, there's no point.

@Blueyescat
Copy link

Blueyescat commented Dec 30, 2017

You can use last gui already. Also as i remember you can use

make gui ...:
    uncancel event

to get stealable items, also with actions.

@HYPExMon5ter
Copy link
Contributor Author

that'd make all items stealable, i want specific items stealable.

@Blueyescat
Copy link

Blueyescat commented Dec 30, 2017

No it shouldn't do that. The manager cancels inventory click event when you click on a gui item, this uncancels it.

last gui in create gui section works fine by the way, i tested it.

@HYPExMon5ter
Copy link
Contributor Author

oh i see what you're saying. Like

make gui slot 1 with grass:
    uncancel event

? that way only the grass would be stealable?

@Blueyescat
Copy link

Yeah. The code in the make gui section runs on inventory click event.

@HYPExMon5ter
Copy link
Contributor Author

Anyways, I only posted this cause I was asked by tuke to do so lol

@Blueyescat
Copy link

Blueyescat commented Dec 30, 2017

[the] gui support may look better than last gui when used in create gui section. Since last gui in create gui works it is easy to do. But still i can't see advantages 😛

@Tuke-Nuke
Copy link
Owner

I tested it and I can't replicate your issue. The gui expression is used when you click in a gui slot, if it's outside of make gui effect like your example, the right one is last gui. It might be just a syntax mistake where the syntax last [created] gui represents the current gui that is being created/edited.
So your code will work fine as:

command /bug:
	trigger:
		create a gui with virtual chest with 2 rows named "TuSKe Bug":
			make gui slot 1, 3, 10, 11, 12, 19, 28, 36, 37, 45, 46, 52 and 53 with black stained glass pane named "&0"
			if slot 1 of last gui is dirt:
				make gui slot 1 with grass
			else:
				make gui slot 1 with diamond block
		open last created gui to player

@HYPExMon5ter
Copy link
Contributor Author

Oh okay, thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants