Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on break event for item frames and paintings and more #892

Closed
Spiralexe opened this issue Sep 24, 2017 · 7 comments
Closed

on break event for item frames and paintings and more #892

Spiralexe opened this issue Sep 24, 2017 · 7 comments
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@Spiralexe
Copy link

Spiralexe commented Sep 24, 2017

using the on break: event
and breaking an item frame triggers the event but player isn't set
same goes for paintings

and event-block / event-item are both not set either

mc 1.12.1
skript 2.2-dev29

@JeepSmash
Copy link
Contributor

Item frames and paintings should not use on break events since they are entities and not blocks. They are covered by the on damage event. Regarding item frames: On right click events are not called if players click on item frames making it impossible to stop players from placing items in empty frames or rotating the items in frames. This was reported 10 months ago and hasn't been fixed #290

on damage of item frame:

on damage of painting:

@TheBentoBox
Copy link
Member

Yeah, you shouldn't be using on break, but hanging entities probably shouldn't fire break events so that people can't make this mistake (possibly with an error message telling them to use on damage).

@TheBentoBox TheBentoBox added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Sep 29, 2017
@Syst3ms
Copy link
Contributor

Syst3ms commented Sep 29, 2017

Using on break: with an hanging entity only works because they have aliases for their corresponding items. What would be more efficient would be to error when using an alias of an item and implement an error specific to hanging entities on the fly.

@JeepSmash
Copy link
Contributor

After doing some more testing with this stuff regarding item frames and paintings:

1 'on break' is called when a item frame/painting breaks
a The only thing set is event-entity
b event-entity is set to the item frame/painting entity instead of the player breaking it
3 'on damage of item frame' is only called when an item is in the frame and not when it is empty and breaking
4 'on damage of painting' is never called
5 when a player left clicks to break empty item frame/painting there is no 'on click' event called
6 No click event is called when a player right clicks an item frame with an item in it (rotating it)

If trying to detect players breaking an item frame the only thing i can think of is using the on 'break event' and looping the players in a 5 block radius around the event-entity (the max distance a player can hit an entity from with their hands). But if multiple players are in that radius there is no way to know which unless you check their targeted entity/block but if they are causing the damage from a farther distance with a projectile/piston/liquid/etc there is no 100% sure way to tell until something here is fixed. It would be nice if both 'on break' and 'on damage' events were called for the case of the item frame and painting so players could use which ever meets their needs best. But at this point at least one is needed to be able to detect a player breaking those entities properly.

@bensku bensku added this to the 2.3 milestone Sep 30, 2017
@bensku bensku added the priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). label Jan 31, 2018
@bensku bensku removed this from the 2.3 milestone Mar 2, 2019
@Matocolotoe
Copy link
Contributor

the only way to prevent this is to use HangingBreakEvent and/or HangingBreakByEntityEvent

@Whimsyturtle Whimsyturtle added the needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. label Jul 10, 2020
@lemonypancakes
Copy link

Still having the issue today with the latest version

@lemonypancakes
Copy link

I fixed it by using BlockBreakEvent instead of "break"
and used event.getPlayer() instead of "event-player" or "player" and event.getBlock()
skript-mirror

@TPGamesNL TPGamesNL changed the title on break: on break event for item frames and paintings and more Jan 18, 2022
@AyhamAl-Ali AyhamAl-Ali added PR available Issues which have a yet-to-be merged PR resolving it and removed needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. labels Feb 28, 2022
@TPGamesNL TPGamesNL added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests